@@ -37,7 +37,7 @@ open class KeychainPreferences: PreferencesAdapter {
3737 // MARK: constantes
3838
3939 /// Shared instance. service is equal to bundle identifier.
40- public static var sharedInstance = KeychainPreferences ( service: Bundle . main. bundleIdentifier ?? " Prephirences " )
40+ nonisolated ( unsafe ) public static var sharedInstance = KeychainPreferences ( service: Bundle . main. bundleIdentifier ?? " Prephirences " )
4141
4242 /// Class Constants
4343 static let klass = String ( kSecClass)
@@ -55,8 +55,8 @@ open class KeychainPreferences: PreferencesAdapter {
5555 static let limit = String ( kSecMatchLimit)
5656
5757 struct Limit {
58- static let one = kSecMatchLimitOne
59- static let all = kSecMatchLimitAll
58+ static let one = String ( kSecMatchLimitOne)
59+ static let all = String ( kSecMatchLimitAll)
6060 }
6161 }
6262
@@ -265,7 +265,7 @@ open class KeychainPreferences: PreferencesAdapter {
265265 query [ Return . data] = kCFBooleanTrue
266266 query [ Return . persistentRef] = kCFBooleanTrue
267267 query [ Return . ref] = kCFBooleanTrue
268- query [ Match . limit] = Match . Limit. one
268+ query [ Match . limit] = Match . Limit. one as CFString
269269
270270 var result : AnyObject ?
271271 let status = SecItemCopyMatching ( query as CFDictionary , & result)
@@ -321,7 +321,7 @@ extension KeychainPreferences: MutablePreferencesType {
321321 var query : [ String : Any ] = newQuery ( )
322322 query [ Attribute . account] = key
323323 query [ Return . data] = kCFBooleanTrue
324- query [ Match . limit] = Match . Limit. one
324+ query [ Match . limit] = Match . Limit. one as CFString
325325
326326 var result : AnyObject ?
327327 let status = SecItemCopyMatching ( query as CFDictionary , & result)
@@ -335,7 +335,7 @@ extension KeychainPreferences: MutablePreferencesType {
335335 public func keys( ) -> [ String ] {
336336 var query : [ String : Any ] = newQuery ( )
337337 query [ Return . attributes] = kCFBooleanTrue
338- query [ Match . limit] = Match . Limit. all
338+ query [ Match . limit] = Match . Limit. all as CFString
339339
340340 var result : AnyObject ?
341341 let status = SecItemCopyMatching ( query as CFDictionary , & result)
@@ -354,7 +354,7 @@ extension KeychainPreferences: MutablePreferencesType {
354354 #if os(iOS) || os(watchOS) || os(tvOS)
355355 query [ Return . data] = kCFBooleanTrue
356356 #endif
357- query [ Match . limit] = Match . Limit. all
357+ query [ Match . limit] = Match . Limit. all as CFString
358358
359359 var result : AnyObject ?
360360 let status = SecItemCopyMatching ( query as CFDictionary , & result)
@@ -448,7 +448,7 @@ extension KeychainPreferences: MutablePreferencesType {
448448 public func clearAll( ) {
449449 var query : [ String : Any ] = newQuery ( )
450450 #if !os(iOS) && !os(watchOS) && !os(tvOS)
451- query [ Match . limit] = Match . Limit. all
451+ query [ Match . limit] = Match . Limit. all as CFString
452452 #endif
453453 delete ( query: query)
454454 }
0 commit comments