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.
Asked
Active
Viewed 951 times
3 Answers
4
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

Shivam Parmar
- 1,520
- 11
- 27
-
let me check that. – Pathak Ayush Feb 28 '20 at 09:41
-
sure it will open number-pad – Shivam Parmar Feb 28 '20 at 09:42
-
don't want to open the number pad. just check the above image – Pathak Ayush Feb 28 '20 at 09:56
-
1@ap00724 it's better to open number pad but just replace `UIKeyboardType.decimalPad` to `UIKeyboardType.numbersAndPunctuation` – Kishan Bhatiya Feb 28 '20 at 10:02
1
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

Pathak Ayush
- 726
- 12
- 24
-1
textField.keyboardType = .emailAddress
After = . (Multiple Suggestions for keyboard type you can select according to your usage)

rahul
- 61
- 2