允许在键盘 iOS10 中进行完全访问检查
- 作者: 似曾相识燕归来20795590
- 来源: 51数据库
- 2023-02-09
问题描述
最近 iOS 更新了 iOS 10 &对开发人员有一些更改,其中一项更改是现在我们无法检查 允许完全访问 我们以前的方式如下所示
Recently iOS has an update of iOS 10 & there are certain changes for developers one of the change is now we can't check allow full access the way we did previously is given below
-(BOOL)isOpenAccessGranted{ return [UIPasteboard generalPasteboard]; }
我搜索了最新的UIPasteboard 开发者指南,但找不到解决它.有没有人对此有适当的解决方案.
I searched the latest Developer Guide for UIPasteboard, but was unable to solve it. Did any one has a proper solution for this.
推荐答案
iOS11及以上很简单.
iOS11 and above is easy.
iOS10 解决方案:勾选所有可复制类型,如果其中一个可用,则您有完全访问权限,否则没有.
iOS10 Solution: Check all the copy-able types, if one of them is available, you have full access otherwise not.
-- 斯威夫特 4.2--
-- Swift 4.2--
override var hasFullAccess: Bool { if #available(iOS 11.0, *){ return super.hasFullAccess// super is UIInputViewController. } 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) } }
推荐阅读
热点文章
检查拆分键盘
0
带有“上一个"的工具栏和“下一个"用于键盘输入AccessoryView
0
Activity 启动时显示软键盘
0
UIWebView 键盘 - 摆脱“上一个/下一个/完成"酒吧
0
在 iOS7 中边缘滑动时,使键盘与 UIView 同步动画
0
我的 iOS 应用程序中的键盘在 iPhone 6 上太高了.如何在 XCode 中调整键盘的分辨率?
0
android:inputType="textEmailAddress";- '@' 键和 '.com' 键?
0
禁用 iPhone 中键盘的方向
0
Android 2.3 模拟器上的印地语键盘问题
0
keyDown 没有被调用
0