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?
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?
不,这太难了,因为大多数UITextField/UITextView只能处理NSString对象。
如中所述,UITextDocumentProxy仅NSStrings允许。
UITextDocumentProxy是 使用的通信对象UIInputViewController。UIInputViewController似乎是创建自定义键盘的基础。
您可以创建 twitter 风格的解决方法:当用户选择图像时,您将其上传到您的服务器并发送一个缩短的 url 作为响应。这个缩短的 url 将被插入到主机应用程序的文本视图中,祝你好运 :)