Custom keyboard.

I have created a keyboard extension but I do not feel the responsiveness like the default keyboard. I feel I have to mash down the keys and I feel when typing quickly the touch will skip a letter or two till the UI catches back up.


My process - I have an xib that the visual is made. I have created my view then I added a view inside that and then 4 rows(views) inside that. In the rows I place the buttons. I had the touch down event for the buttons but that seemed it wouldn't register some times so I moved to the touch up and outside and inside but then I felt the edges when clicked wouldnt register. I know moved to every button in the key board has a tap gesture. This seems to be alot better but still missing the fluidness of the default keyboard. I am not expecting it to be perfect but something like swiftkey.


Please ask if you want to see anything or if anything didnt make sense.


Thank you!

Did you use keyboard extension ?


Should read this tutorial, which has sample code as well.


h ttps://www.raywenderlich.com/49-custom-keyboard-extensions-getting-started

Yeah I have made a keyboard extension but I was looking over that and he programmatically added the touch events

morseKeyboardView.nextKeyboardButton.addTarget(self,action: #selector(handleInputModeList(from:with:)),for: .allTouchEvents)

Maybe that would make a difference but that is the only thing I really didn't have.

I had this exact same problem and finally found a complete fix. The issue is that iOS system edge gestures intercept your touches before they reach your keyboard buttons. The solution requires targeting three separate mechanisms simultaneously:

here's the complete solution: https://gist.github.com/hamdiqbal/f642e2d73d58e76f65a76dc10b44e725

The three reasons most solutions fail:

  1. Only disabling delaysTouchesBegan — two other delay sources remain active
  2. Only calling setNeedsUpdateOfScreenEdgesDeferringSystemGestures() once — iOS resets this during view transitions
  3. Only fixing their own view — system gesture recognizers on parent views continue stealing touches

After implementing all three parts together my keyboard edge keys respond instantly — as fast as the native iOS keyboard.

Custom keyboard.
 
 
Q