8

I have texFiled I'm my view controller and i set number pad for that like this:

self.phoneTextField.keyboardType = UIKeyboardTypeNumberPad; 

And now i want user just can enter english number in text field(can not change language)

enter image description here

reza_khalafi
  • 6,230
  • 7
  • 56
  • 82

2 Answers2

8

(This only applies for iOS 10 or later and for number pad)

Swift

yourTextField.keyboardType = .asciiCapableNumberPad

Objective C

yourTextField.keyboardType = UIKeyboardTypeASCIICapableNumberPad;
Vineeth Joseph
  • 5,177
  • 3
  • 17
  • 31
5

NO,we can't disable or Hidden the keyboard properties, it is not possible to handle the default property of Keyboardtypein iOS, if you want to make it own customization then you go for Custom Keyboard Concept. else try once with another keyboard Types

Choice 2

in that place you can add one Overlay for disable , you can get the sample from here.but

If Apple figures out that the key is covered or. disabled they will most likely reject the app.

Community
  • 1
  • 1
Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143