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 339 forks source link

Xcode 10.2 warning removal #120

Closed mirekp closed 5 years ago

mirekp commented 5 years ago

Removed compilation warning related to incorrectly used @available attribute shown when compiling in Xcode 10.2

SpacyRicochet commented 5 years ago

Also, I found the following warning as well. Did you encounter this, @mirekp?

Screenshot 2019-04-02 at 17 17 13

The warning that kCFBooleanTrue is implicitly coerced to Any is found on line 118 of KeychainWrapper.swift.

Considering the location and its relative safety, I propose to update it by force-unwrapping it.

        var keychainQueryDictionary: [String:Any] = [
            SecClass: kSecClassGenericPassword,
            SecAttrService: serviceName,
            SecReturnAttributes: kCFBooleanTrue!, // Force unwrap.
            SecMatchLimit: kSecMatchLimitAll,
        ]
mirekp commented 5 years ago

@jrendel

twostraws commented 5 years ago

This and #121 are both small but important changes, @jrendel. Are you able to merge them? If not, would it be worthwhile transferring ownership of the project to someone else so it can be maintained? SwiftKeychainWrapper is a really useful project and I know it's popular, so it would be great to see it up to date and warning-free for Swift 5.

jrendel commented 5 years ago

Sorry guys, will try to do better at keeping this up!