vandadnp / iOS-8-Swift-Programming-Cookbook

This is the GitHub repository of O'Reilly's iOS 8 Swift Programming Cookbook
1.35k stars 481 forks source link

Custom keyboard code issue #1

Open ugol opened 9 years ago

ugol commented 9 years ago

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!)
     }
   }
ugol commented 9 years ago

Additionally, I have no idea on how to debug it, the standard techniques don't work on the custom keyboard code (NSLog neither)

ugol commented 9 years ago

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

vandadnp commented 9 years ago

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