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