Quick iPhone SDK Observation
I spent most of last evening and some of this morning sifting through the various documentation and classes for the UIKit framework distributed with the iPhone/Cocoa Touch SDK. So, for the very quick, but cool observation.
You can easily create a UITextField to handle text input. The interesting part comes into play because there is a keyboard associated with the UITextField, obviously for providing input. That keyboard can be specified what action to do when the return button is pressed, giving a way to process the text. The cool part is, it’s extremely easy for developers to use the many different types of keyboards present on the iPhone. For example, there is a numeric keyboard, the default keyboard, one for entering URLs, one for entering email addresses, and so on. Below is a quick code block, adapted from the “Hello World” example.
aTextField.borderStyle = UITextFieldBorderStyleRounded;
aTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
aTextField.placeholder = @”Your name”;
aTextField.keyboardType = UIKeyboardTypeEmailAddress;
Some other examples of keyboard types:
- UIKeyboardTypeDefault
- UIKeyboardTypeNamePhonePad
- UIKeyboardTypeNumberPad
- UIKeyboardTypeNumbersAndPunctuation
- UIKeyboardTypePhonePad
- UIKeyboardTypeURL














Submitting Your Comment, give me a second...
Does this mean that developers can create a new keypad layout and cause it to pop up as the default keypad?