How to enable Only Numeric Digit Keyboard ios Swift
use this code
textfield.keyboardType = .asciiCapableNumberPad
Through Code you can do it by
override func viewDidLoad() {
super.viewDidLoad()
yourTextField.keyboardType = .numberPad //or .asciicapableNumberPad
}
OR
If you are using storyboard follow this
Change Keyboard type to Number Pad . or ascii capable Number Pad