允许在键盘 iOS10 中进行完全访问检查

Allow Full Access check in keyboards iOS10(允许在键盘 iOS10 中进行完全访问检查)
本文介绍了允许在键盘 iOS10 中进行完全访问检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

最近 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)
    }
}

这篇关于允许在键盘 iOS10 中进行完全访问检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
Resume game cocos2d(恢复游戏 cocos2d)
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
[ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)
Storing and reading files from Documents directory iOS 5(从 Documents 目录存储和读取文件 iOS 5)
How can I implement a virtual joystick for a cocos2d game outside the cocos2d environment?(如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?)