允许在键盘 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 中进行完全访问检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

No resource found that matches the given name: attr #39;android:keyboardNavigationCluster#39;. when updating to Support Library 26.0.0(找不到与给定名称匹配的资源:attr android:keyboardNavigationCluster.更新到支持库 26.0.0 时) - IT屋-程序员软
How to resize UITextView on iOS when a keyboard appears?(出现键盘时如何在iOS上调整UITextView的大小?)
How to reliably detect if an external keyboard is connected on iOS 9?(如何可靠地检测 iOS 9 上是否连接了外部键盘?)
How to mimic Keyboard animation on iOS 7 to add quot;Donequot; button to numeric keyboard?(如何在 iOS 7 上模拟键盘动画以添加“完成数字键盘的按钮?)
How do I dismiss the iOS keyboard?(如何关闭 iOS 键盘?)
Is possible to simulate touch event using an external keyboard on ios jailbroken?(是否可以在 ios 越狱后使用外部键盘模拟触摸事件?)