evgenyneu / keychain-swift

Helper functions for saving text in Keychain securely for iOS, OS X, tvOS and watchOS.
MIT License
2.85k stars 345 forks source link

Is keychain.clear() intended to always return false when no keys are saved? #155

Open crisanvlad opened 2 years ago

crisanvlad commented 2 years ago

I am implementing a feature to let the user reset the keychain in case there are issues and I check

if keychain.clear() {
// clearing successfull
} else {
//show error
}

And I was wondering if the clear() method shouldn't check inside if keychain.allKeys is empty before returning false.