When I open the app, In App Delegate I can see that there is a value in Keychain and KeychainWrapper is successfully fetching it.
But when I try to remove it [ Using that specific key ] it always return false. So I tried removeAllKeys method that also returns nil. I have tried re-booting my system, tried in different computers. Don't know what's happening in here.
It's a Cocoa App. Deployment Target : 10.10
if let _ = KeychainWrapper.defaultKeychainWrapper().stringForKey(UserDefaults.TokenSet_Secret.rawValue)
{
// Always here - Value is there
}
else
{
//
}
let success = KeychainWrapper.defaultKeychainWrapper().removeObjectForKey(UserDefaults.TokenSet_Secret.rawValue)
if success {
// Dismiss
self.delegate?.clickedOnDismiss()
dismissController(self)
}
else {
// Always comes here :(
// Show Alert
self.presentAlertController(UserConstants.alertTitle_Oops, message: UserConstants.WritingTweets.CoultNotGetToken.rawValue)
}
Please guide me, and let me know if I miss anything.
I've tested this in the latest Swift 3 version of the library and it is working as expected. I added examples of how to use them in the example app and you can see the specific commit here:
When I open the app, In
App Delegate
I can see that there is a value inKeychain
andKeychainWrapper
is successfully fetching it.But when I try to remove it [ Using that specific key ] it always return false. So I tried
removeAllKeys
method that also returns nil. I have tried re-booting my system, tried in different computers. Don't know what's happening in here.It's a
Cocoa App
. Deployment Target :10.10
Please guide me, and let me know if I miss anything.