How to check the “Allow Full Access” is enabled in iOS 8?

后端 未结 15 1273
醉酒成梦
醉酒成梦 2020-12-02 07:53

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

15条回答
  •  余生分开走
    2020-12-02 08:11

    For iOS 10 using Swift 2.3 (if you don't want to convert your files to Swift 3.0)

    func isOpenAccessGranted() -> Bool {
        if #available(iOSApplicationExtension 10.0, *) {
    
        let originalString = UIPasteboard.generalPasteboard().string
        UIPasteboard.generalPasteboard().string = "Test"
    
        if UIPasteboard.generalPasteboard().hasStrings {
                UIPasteboard.generalPasteboard().string = originalString
                return true
            } else {
                return false
            }
        } else {
            return UIPasteboard.generalPasteboard().isKindOfClass(UIPasteboard)
        }
    }
    

提交回复
热议问题