As much as i know when we switch between Standard and Zoomed view iphone restarts in background. I have some code in didFinishLaunchingWithOptions method for clearing keychain if its a fresh install. Now when ever i switch view[standard to zoomed] iOs treats it as a fresh install and clears keychain, thus making my application crash. Is there anyway to know in code that view is changed so i can stop application from reseting keychain. Here is the code snippet:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
if !Foundation.UserDefaults.standard.bool(forKey: Keys.kIsFreshInstall)
{
print(“clearing keychain”)
EMKeychainUtil.clearKeychain()
Foundation.UserDefaults.standard.set(true, forKey:Keys.kIsFreshInstall)
}
return true
}
Powered by WPeMatico