1
votes

I have some alphanumeric content that gets entered routinely and is mostly numbers, so I'm wondering if there's a way to start in the numeric side of the keyboard but still have the option to switch to the alphabetic keyboard in Objective-C for iPhone development specifically. I've found plenty of info on using the numeric keyboard but I'd like to start there but still be able to enter letters if that's possible.

Thanks.

2

2 Answers

2
votes

Set the keyboardType property to UIKeyboardTypeNumbersAndPunctuation.

This will default the iPhone's keyboard to show numbers and punctuation but the little "ABC" key will be in the bottom left allowing the user to switch back to the letters (and then back to numbers and punctuation).

0
votes

Try this:

[Objective - C]

[self.myTextField setKeyboardType: UIKeyboardTypeNumbersAndPunctuation];

[Swift]

self.myTextField.keyboardType = .NumbersAndPunctuation

// You can also set this property from the storyboard.