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.
my project structure
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