问题
I'm implementing autoFill to my iOS app using this tutorial "iOS 12 Password Tools: Improving User Security and Experience" everything work fine but the iOS is not prompt me with UIAlert to save the password when I login for the first time. I want to ask how I can trigger the UIAlert to prompt the user to save the password to keychain first time?
回答1:
you have to clear the text fields and remove the view for View hierarchy.
Note: with Xcode 10 you can use save the username password in the simulator.
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
view.endEditing(true)
txtfEmail.text = nil
txtfPassword.text = nil
}
来源:https://stackoverflow.com/questions/55831632/autofill-ios12-alert-message-user-to-save-password-after-login-to-the-app-first