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

后端 未结 15 1239
醉酒成梦
醉酒成梦 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:17

    iOS 11 no longer requires any hacks.

      override var hasFullAccess: Bool {
        if #available(iOS 11.0, *) {
          return super.hasFullAccess// super is UIInputViewController.
        }
        if #available(iOS 10.0, *) {
          let original: String? = UIPasteboard.general.string
          UIPasteboard.general.string = " "
          let val: Bool = UIPasteboard.general.hasStrings
          if let str = original {
            UIPasteboard.general.string = str
          }
          return val
        }
        return UIPasteboard.general.isKind(of: UIPasteboard.self)
      }
    

提交回复
热议问题