iOS-8-Swift-Programming-Cookbook
iOS-8-Swift-Programming-Cookbook copied to clipboard
Custom keyboard code issue
The keyboard shows correctly, but when you tap everywhere you got a:
Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=0x17027c540 {Message=Service Connection Interrupted}
Note that I also had to slightly modify the handleTapOnButton func to compile the code on Xcode 6 GA:
func handleTapOnButton(button: UIButton){
let buttonText = button.titleForState(.Normal)
if let proxy = textDocumentProxy{
- proxy.insertText(buttonText)
+ proxy.insertText(buttonText!)
}
}
Additionally, I have no idea on how to debug it, the standard techniques don't work on the custom keyboard code (NSLog neither)
How to debug a custom keyboard: https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html#//apple_ref/doc/uid/TP40014214-CH16-SW6
Please try this on Xcode 6.1 Beta 2, Apple seems to have fixed this issue.
Please also git fetch the latest code to get the latest code for the handleTapOnButton: method