iOS8 Custom Keyboard - Copy amp; Paste to UIPasteboard(iOS8 自定义键盘 - 复制 amp;粘贴到 UIPasteboard)
问题描述
是否可以在键盘扩展中将文本/图像复制到 UIPasteboard?类似于 popkey.co 处理动画图像.
Is it possible to copy text/image to UIPasteboard in a keyboard extension? Similar to what popkey.co does with animated images.
我测试了下面的代码,它似乎没有工作.
I tested the following code and it doesn't seem to be working.
func copyImage() {
UIPasteboard.generalPasteboard().string = "copy test"
}
它总是显示这个错误信息:
It always shows this error message:
UIPasteboard - 无法启动 pasteboardd.确保它已安装在 UIKit.framework/Support 中
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support
您知道从键盘扩展使用复制和粘贴的任何其他方式吗?
Do you know about any other way to use copy&paste from a keyboard extension?
推荐答案
如果我在 Settings->General->Keyboard 应用程序中为我的自定义键盘提供完全访问权限",我就能做到这一点.您需要在 Info.plist 文件中包含 "RequestsOpenAccess" = YES.并且您必须在设置"应用中打开完全访问权限".
I was able to do it if I gave my custom keyboard "Full Access" in the Settings->General->Keyboard app. You need to include "RequestsOpenAccess" = YES in your Info.plist file. AND you have to toggle "Full Access" on in the Settings app.
似乎 Apple 正在限制对一般 UIPasteboard 的访问.
Seems like Apple is restricting access to the general UIPasteboard otherwise.
这篇关于iOS8 自定义键盘 - 复制 &粘贴到 UIPasteboard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:iOS8 自定义键盘 - 复制 &粘贴到 UIPasteboard


- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01