-(BOol)isOpenAccessGranted{ return [UIPasteboard generalPasteboard]; }
我搜索了最新的Developer Guide for UIPasteboard,但无法解决.有没有人有一个适当的解决方案.
解决方法 iOS10解决方案:检查所有可复制的类型,如果其中一个可用,则您将获得完全访问权限.P.S:新手机和iOS更新案例修复后.
– 斯威夫特2.3–
static func isFullAccessGranted() -> Bool{ if #available(iOSApplicationExtension 10.0,*) { if UIPasteboard.generalPasteboard().hasstrings { return true } else if UIPasteboard.generalPasteboard().hasURLs { return true } else if UIPasteboard.generalPasteboard().hascolors { return true } else if UIPasteboard.generalPasteboard().hasImages { return true } else // In case the pasteboard is blank { UIPasteboard.generalPasteboard().string = "" if UIPasteboard.generalPasteboard().hasstrings { return true }else { return false } } } else { // before iOS10 if UIPasteboard.generalPasteboard().isKindOfClass( UIPasteboard) { return true }else { return false } }}
– Swift 3.0–
static func isFullAccessGranted() -> Bool{ if #available(iOSApplicationExtension 10.0,*) { if UIPasteboard.general.hasstrings { return true } else if UIPasteboard.general.hasURLs { return true } else if UIPasteboard.general.hascolors { return true } else if UIPasteboard.general.hasImages { return true } else // In case the pasteboard is blank { UIPasteboard.general.string = "" if UIPasteboard.general.hasstrings { return true }else { return false } } } else { // before iOS10 return UIPasteboard.general.isKind(of: UIPasteboard.self) }}总结
以上是内存溢出为你收集整理的允许完全访问权限检查键盘iOS10全部内容,希望文章能够帮你解决允许完全访问权限检查键盘iOS10所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)