Search code examples
iosswiftxcodeipad

NumberPad for iPad?


I set Number Pad for my TextField on the Storyboard, because I need only numbers for my app. But it works for iPhone only. I can't find solution for iPad. I tried

override func viewDidLoad() {
        super.viewDidLoad()

        self.myTextField.keyboardType = .numberPad

but it doesn't work. Help me please.


Solution

  • iPad doesn't have number only keyboard. You should implement your own. There are some git projects you can use like these:

    - Some Swift Repositories:

    - Some Objective-c Repositories: