Marco Cancellieri 7 年之前
父节点
当前提交
f8aa7037dd
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      Lib/KeychainAccess/Keychain.swift

+ 2 - 4
Lib/KeychainAccess/Keychain.swift

@@ -744,15 +744,13 @@ public final class Keychain {
     public func contains(_ key: String) throws -> Bool {
         var query = options.query()
         query[AttributeAccount] = key
-        if #available(iOSApplicationExtension 9.0, *) {
+        if #available(iOS 9.0, OSX 10.11, *) {
             query[UseAuthenticationUI] = UseAuthenticationUIFail
         }
         
         let status = SecItemCopyMatching(query as CFDictionary, nil)
         switch status {
-        case errSecSuccess:
-            return true
-        case errSecInteractionNotAllowed:
+        case errSecSuccess, errSecInteractionNotAllowed:
             return true
         case errSecItemNotFound:
             return false