Create an iPhone, iPod or iPad app – Part 2 – Adding User Interface elements

Add user interface elements to the view

  • Open the MainStoryboard.storyboard file in the project navigator
  • Open the Utilities area by clicking the right most view button in the upper right corner of the screen
  • In the Library selector bar of the Utilities area select the object library

xcode object library

  • From the list drag a Text Field, a Label, and a Button  to the view

xcode adding text field

  • When you drag the UI elements on the canvas blue alignment guides appear to help you to align the elements on the view

xcode moving text field

  • To resize the UI elements drag the white squares at the middle of the sides or in the corners

xcode resize handles

  • The blue alignment guides also help you to set the proper size

xcode extending text field

Set the attributes of the User Interface elements

  • If necessary open the Attributes inspector by clicking the Attributes icon in the Inspector selector bar

xcode inspector attributes

  • Select the text field and enter the description of the text field in the Placeholder field of the Attributes inspector
  • With the Alignment attribute you can align the text to left, center or right

xcode text field attributes

  • To specify how the text field will be used, specify scroll down to the bottom of the Text Field area and set
    • Capitalization to Words
    • Correction to No
    • Keyboard to Default
    • Appearance to Default
    • Return key to Done

 

To add an action to a button

  • Hide the Utilities area by clicking the right most View button in the upper right corner of the screen
  • Open the Assistant area by clicking the xcode assistant editor button Assistant Editor button in the upper right corner of the screen
  • Make sure that the Assistant displays the view controller’s implementation file (that is, ...ViewController.m). If it shows ...ViewController.h instead, click the ...ViewController.h text above the editor area and select ...ViewController.m
  • Press the Control key on the keyboard and drag the button to the @interface section of the …ViewController.m editor

xcode dragging for action

 

  • When you release the Control key a pop-over appears

xcode action popover

  • In the Connection pop-up menu select Actionhe
  • In the Name field enter changeGreeting:  and finish the word with a colon(:)
  • Leave the Type field as id
  • Leave the Event pop-up menu as Touch Up Inside
  • Make sure the Arguments pop-up menu displays Sender
  • Click the Connect button to close the dialog

A few new lines of code appears in the …ViewController.m file with a gray filled circle on the left to indicate that a connection has been made between the button and the Controller

xcode action connection made

To get the user input from a text field create an Outlet

Control drag the text field to the @interface area of the …ViewController.m file

xcode dragging for outlet

In the pop-over set the following values

xcode configure text field outlet

  • Make sure the Connection contains Outlet
  • In the Name field type textField
  • Make sure the Type contains UITextField
  • Make sure the Storage is set to Weak
  • Click the Connect button to close the pop-over

To display the result in a label create an Outlet for the label

  • Control drag the label to the @interface section of the @…ViewController.m file
  • Make sure that the Connection pop-up menu contains Outlet.
  • In the Name field, type label
  • Make sure that the Type field contains UILabel
  • Make sure that the Storage pop-up menu contains Weak
  • In the popover, click Connect.

To view the connections you just created

  •  Click the Standard editor button to close the assistant editor and switch to the standard editor view. The Standard editor button is the leftmost Editor button and it looks like this: xcode standard editor button
  • Click the Utilities view button to open the utilities area.
  • Select the View Controller in the outline view.
  • Show the Connections inspector in the utilities area. The Connections inspector button is the rightmost button in the inspector selector bar, and it looks like this: xcode connections inspector button

xcode verify connections

Specify the View Controller as the delegate object for the text field to close the keyboard when the user clicks the Done button

  •  Make sure the MainStoryboard.storyboard is selected in the project navigator on the left side of the screen
  • Control drag the text field to the bottom of the canvas onto the yellow sphere that represents the View Controller
  • When you release the Control key you will see this

xcode tex field delegate

  • Select delegate in the Outlets section of the pop-over

To add accessibility hint to the text field, so the Apple VoiceOver screen reader can help people with visual disability

  •  Select the storyboard file in the project navigator on the left side of the screen
  • Select the text field

xcode type accessibility hint

  •  In the upper right corner select the Utilities view button
  • In the Inspector bar select the Identity inspector button
  • Enter the hint in the Accessibility section

Create an iPhone, iPod or iPad app – Part 1 – Getting started

As of the writing of this article to create iOS apps for iPhone, iPod and iPad you need a Macintosh computer with the Lion (Mac OS X 10.7),  Mountain Lion (Mac OS X 10.8) or later operating system.

Check the hardware requirements of Lion and Mountain Lion if you need to upgrade you computer from Snow Leopard (Mac OS X 10.6) or earlier, because Mountain Lion only runs on newer models with aluminum housing. If you have an earlier model with black or white housing from 2008 upgrading to Lion can be your solution. My black MacBook with the serial number ending with UMoP2 can only be upgraded to Lion.

To see the serial number of your Mac

  • Click the Apple icon in the upper right corner of the screen
  • Select About This Mac
  • On the popup window double click the word Version under the Mac OS X text

To deploy your app to any Apple device or submit it to the Apple App Store  you need to register as a developer at developer.apple.com and pay $99 plus tax a year membership fee.

To test the app on your Macintosh in an iOS simulator you don’t need the developer account, just download Xcode, the Apple development environment for free. This way you can decide without paying anything if you are interested in the Apple iOS app development.

In this series of articles we will use Xcode, the Apple development platform to create, test and deploy our applications.

To get Xcode

  • Start the Mac App Store application in your Mac
  • Download Xcode, the Apple IDE for iOS and Mac software development

The first steps

  • Start Xcode
  • On the Welcome page click Create a new Xcode project
  • To create an iOS application for iPhone, iPod or iPad click Application under iOS on the left side
  • Select the application type you want to develop
    • To create a simple one page application select Single View Application
  • Enter the name and other parameters of the application
    • Enter your initials for the class prefix to create a unique set of classes
  • Create a folder for the application in the Documents folder of your computer and save the project in that folder

xcode workspace

Set the initial view (the view that opens when the app starts)

In this example you can skip this if you selected the Single View Application, but later when you create apps with multiple views this will be the way to select the view that loads when the app starts.

  • Open the storyboard file
    • In the project navigator on the left side of the screen click the MainStoryBoard_iPhone.storyboard item

xcode storyboard

 

  • In the middle pane select the Controller you want to handle the initial view
  • To display the Utilities pane click the right View button in the upper right corner
  • To display the Attributes click the Attributes icon in the Inspector selector bar

xcode inspector attributes

  • In the View Controller section click the Initial Scene check box

xcode initial scene option

Set the background color of the view

  • In the middle of the screen select the view you want to modify
  • Open the Attributes inspector as described above
  • In the Attributes inspector set the background color

xcode background color button

To open the color wheel to select from all possible colors select Other in the Background drop down list

xcode color wheel

Run the application in the iOS Simulator

  • Select the device you want to simulate in the Scheme pop-up menu on the top of the screen next to the Stop button
  • Click the Run button to compile and run your app
  • The simulator does not have a stop button, but you can close it in the iOS Simulator menu.

Disable the animation in Microsoft Ofice 2013

Microsoft Office 2013 tries to amuse you with new bells and whistles, including animated effects, but when you access your computer via Remote Desktop connection this animation can also make Office very slow.

If you are interested in working with Microsoft Office 2013 without the unwanted entertainment you can turn off the animation by changing the registry entry DisableAnimations.

  • Start Notepad.
  • Copy the following lines into it and save the file to the Desktop as NoAnimation.reg.


    Windows Registry Editor Version 5.00
    [HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\Graphics]
    "DisableAnimations"=dword:00000001

  • Double click the NoAnimation.reg  file on your Desktop.
  • Click Yes on the User Acount Control dialog.
  • Click Yes on the Registry Editor dialog.

    Registry Editor dialog

  • Click Yes on the success notification.

    Registry Editor Success dialog

Mariposa

 

464 km. Útvonal: Santa Monica (10) – (5) Pyramid Lake (99) – Visalia –Fresno – (41) –Oakhurst -(49) –Mariposa

41 C fok árnyékban. Séta a városban, kedves kis város, főleg a “Szalon”. Éjszaka rettenetes meleg és rettenetes zajos légkondi, füldugóval alszunk.

 

2. nap. Yosemite Nemzeti Park


View Larger Map

70 km. Útvonal: Mariposa ( reggel 30 C fok), (140) – A park bejárata után megálltunk, szép rálátás volt a Merced folyóra, sokan fürödtek, a folyón sok kis zuhogó volt. Bementünk a Visitor Centerbe, térkép, stb.

Parkolás, megkerestük a Shutle bust, elmentünk a „8” –as pontig, megkerestük a Valley floor tours indulási helyét. 2 órás utazás megállásokkal a legszebb pontokon, így körbejártuk a park leglátványosabb helyeit. El Capitan-Bridalveil fall-Tunnel View , (itt csodálatos panoráma van a hegyekre)-Half Dome- Campingek-vissza a 8-as pontra.

Visszaérkezés és ebéd után   20 perces sétával elmentünk a  Yosemite fall-hoz.

A Parkban nem volt kibiírhatatlan meleg, csak a napon volt  melegebb.

A Wawona road-on (41), majd a Glacier Point Roadon, rengeteg kanyarral , szerpentineken elmentünk a Glacier Point-hoz. Innen belátható az egész Yosemite Nemzeti Park felülről a camping a sátrakkal együtt, a Half Dome és a vízesések. Nagyon szép a kilátás.Medvével nem találkoztunk szerencsére.Itt sokan várták a naplementét.

Vissza indultunk Mariposába (41)-Oakhurst-  (49).Legalább 1OO kannyar volt a 41-es uton.Éjjel tudtunk aludni, mert a szoba végre lehült és kikapcsoltuk a szörnyeteget.(Kint továbbra is hőség 38 C fok)