3

I need to know how to add long press (press and hold) function to ios custom keyboard extension so that i con show multiple keys to chose one from.

expected design enter image description here

my project structure

enter image description here

current code for keypress action - code can add the title of the button pressed as a new text into any proxy text field.

 @IBAction func keypress(sender: UIButton!){

let typedCharacter = sender.titleLabel?.text
    let proxy = textDocumentProxy as UITextDocumentProxy
    proxy.insertText(typedCharacter!)



}




func loadKeyboard(){

let keyboardNib = UINib(nibName: "View", bundle: nil)
    keyboardView = keyboardNib.instantiateWithOwner(self, options: nil)[0] as! UIView
    view.backgroundColor = keyboardView.backgroundColor
    view.addSubview(keyboardView)



}

Wish to see suggestions and a complete answer preferably

user2994762
  • 115
  • 1
  • 2
  • 10
  • found this similar question - but does not seem easy to understand [enter link description here](http://stackoverflow.com/questions/34585189/custom-keyboard-add-multiple-emoji-icons-while-long-press-on-keyboard-button) – user2994762 Apr 08 '16 at 16:10
  • http://stackoverflow.com/questions/34585189/custom-keyboard-add-multiple-emoji-icons-while-long-press-on-keyboard-button – user2994762 Apr 08 '16 at 16:11

0 Answers0