Custom Keyboard in iOS 8
-
21-12-2019 - |
Question
iOS 8 lets us create our own custom keyboards. Is it possible to make a custom keyboard output anything other than unattributed NSStrings?
Can I make a keyboard that outputs images to say the Messages app, or is it impossible?
Solution
No, this would be too difficult since most UITextField
/ UITextView
can only handle NSString
object.
As described in the UITextDocumentProxy
only NSStrings
are allowed.
UITextDocumentProxy
is the communication object used by UIInputViewController
. UIInputViewController
seems to be the base for creating custom keyboards.
Also have a look at App Extension Programming Guide - Custom Keyboard
OTHER TIPS
You can create a twitter-style workaround: when the user selects an image, you upload it to your server and send a shortened url in reponse. this shortened url will be inserted to the text view of the host app and good luck :)