Pathak Ayush
Pathak Ayush

Reputation: 756

how to change keyboard style programmatically in iOS?

I would like to change the keyboard style. I have attached two pictures one the current situation and the second one is the desired situation.

This image is of current keyboard style.

This is desired keyboard style.

Upvotes: 1

Views: 1474

Answers (3)

rahul
rahul

Reputation: 61

enter image description here - Keyboard Type Suggestions

textField.keyboardType = .emailAddress

After = . (Multiple Suggestions for keyboard type you can select according to your usage)

Upvotes: -1

Shivam Parmar
Shivam Parmar

Reputation: 1570

try this to change the keyboard type:

self.someTextField.keyboardType = UIKeyboardType.decimalPad

and for number with special character try this :-

UIKeyboardType.numbersAndPunctuation

from :- https://developer.apple.com/documentation/uikit/uitextinputtraits#//apple_ref/c/tdef/UIKeyboardType

Upvotes: 4

Pathak Ayush
Pathak Ayush

Reputation: 756

well thanks for suggetions and answers .

i found the solution for it.

for the numbers

textField.keyboardType = UIKeyboardType.numbersAndPunctuation

for the alphabets

textField.keyboardType = UIKeyboardType.emailAddress

Upvotes: 1

Related Questions