3

I created a custom keyboard on xcode using Swift. It works perfectly on simulator but when I tested it on real device the response was very slow (min 5 sec) though keyboard appears quickly. I do not know what is the problem. When button is pressed it takes too much time to type the text or sometimes crashes. Any ideas?

func handleTapOnButton(button: UIButton) {
    let buttonText = button.titleForState(.Normal)
    if let proxy = textDocumentaryProxy {
        if button.titleForState(.Normal) == " " {
            proxy.insertText(" ")
        } else {
            proxy.insertText(buttonText!)
        }
    }
    if globals.tapped != 3 && (switchedToNumbers == false) {
        lowerCase()
        globals.tapped = 1
    }
}
FelixSFD
  • 6,052
  • 10
  • 43
  • 117
Arkalyk Akash
  • 211
  • 2
  • 11

1 Answers1

0

You can you TouchDown Event if you have used TouchUpInside. It may help.

Yogendra Singh
  • 2,063
  • 25
  • 20