如何检查“允许完全访问"在 iOS 8 中启用? [英] How to check the "Allow Full Access" is enabled in iOS 8?

查看:9
本文介绍了如何检查“允许完全访问"在 iOS 8 中启用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 iOS 8 中,当开发自定义键盘并在 info.plist 中将 RequestsOpenAccess 属性设置为 YES 时,在 Settings-> Add New Keyboard 有一个名为Allow Full Access"的切换按钮.自定义键盘代码如何知道用户启用或禁用了此切换?

In iOS 8, when develop a custom keyboard and set RequestsOpenAccess property to YES in info.plist, there is a toggle button at Settings-> Add New Keyboard named "Allow Full Access". How does the custom keyboard code know that the user enabled or disabled this toggle?

推荐答案

更新 08/23/2017 以兼容 iOS 10:

UPDATE 08/23/2017 for iOS 10 compatibility:

func isOpenAccessGranted() -> Bool{
    UIPasteboard.general.string = "CHECK"
    return UIPasteboard.general.hasStrings
}

iOS 8:

-(BOOL)isOpenAccessGranted{
   return [UIPasteboard generalPasteboard];
}

请注意,模拟器将始终告诉您您拥有完全访问权限,因此要使其正常工作,您需要从设备上运行它.

这篇关于如何检查“允许完全访问"在 iOS 8 中启用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆