Skip to Content
Beginning iOS 5 Application Development
book

Beginning iOS 5 Application Development

by Wei-Meng Lee
January 2012
Beginner content levelBeginner
655 pages
16h 35m
English
Wrox
Content preview from Beginning iOS 5 Application Development

USING THE KEYBOARD

In iPhone programming, the views most commonly associated with the keyboard are the Text Field and the Text View. When a Text Field is tapped (or clicked, if you are using the Simulator), the keyboard is automatically displayed. The data that the user taps on the keyboard is then inserted into the Text Field. The following Try It Out demonstrates this.

TRY IT OUT: Using a Text Field for Inputs

image

  1. Using Xcode, create a new Single View Application (iPhone) project and name it Keyboardlnputs. You will also use the project name as the Class Prefix and ensure that you have the Use Automatic Reference Counting option unchecked.
  2. Select the KeyboardInputsViewController.xib file to edit it using Interface Builder.
  3. Populate the View window with the Label and Text Field views (see Figure 6-1). Set the Label to display the text “Alphanumeric Input.”
  4. Press Command-R in Xcode to run the application on the iPhone Simulator. When the application is loaded, the keyboard is initially hidden; and when the user clicks the Text Field, the keyboard automatically appears (see Figure 6-2).

    image

    FIGURE 6-1

    image

    FIGURE 6-2

How It Works

The beauty of the iPhone user interface is that when the system ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering iOS 12 Programming - Third Edition

Mastering iOS 12 Programming - Third Edition

Donny Wals
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer

Publisher Resources

ISBN: 9781118144251Purchase book