jrendel / SwiftKeychainWrapper

A simple wrapper for the iOS Keychain to allow you to use it in a similar fashion to User Defaults. Written in Swift.
MIT License
1.59k stars 340 forks source link

Improve on `KeychainItemAccessibility` #159

Closed sbertix closed 4 years ago

sbertix commented 4 years ago

Version and platform specific logic in order to bypass deprecation warnings, fixing #156.

Defaulting .always to .afterFirstUnlock, and .alwaysThisDeviceOnly to .afterFirstUnlockThisDeviceOnly, on iOS 12.0 and above, my initial implementation, didn't feel like the optimal choice. It truly felt like the only sensible thing to do was marking .always and .alwaysThisDeviceOnly as unavailable for everyone, while allowing users that genuinely need to rely on those cases to pass them themselves, with the addition of a .custom case.

I did not include macCatalyst in the #available statements, as the minimum Swift version for using the library is still set to 4.1.