|
@@ -744,15 +744,13 @@ 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, *) {
|
|
|
|
|
|
+ if #available(iOS 9.0, OSX 10.11, *) {
|
|
query[UseAuthenticationUI] = UseAuthenticationUIFail
|
|
query[UseAuthenticationUI] = UseAuthenticationUIFail
|
|
}
|
|
}
|
|
|
|
|
|
let status = SecItemCopyMatching(query as CFDictionary, nil)
|
|
let status = SecItemCopyMatching(query as CFDictionary, nil)
|
|
switch status {
|
|
switch status {
|
|
- case errSecSuccess:
|
|
|
|
- return true
|
|
|
|
- case errSecInteractionNotAllowed:
|
|
|
|
|
|
+ case errSecSuccess, errSecInteractionNotAllowed:
|
|
return true
|
|
return true
|
|
case errSecItemNotFound:
|
|
case errSecItemNotFound:
|
|
return false
|
|
return false
|