The text field data is disappearing when I navigate to the splash screen, and then back again. This is embedded in a navigation controller.
class LogInViewController: UIViewController, UITextFieldDelegate, UIAlertViewDelegate, PFLogInViewControllerDelegate {
@IBOutlet weak var emailTextField: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
self.emailTextField.delegate = self
}
override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated)
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.hidden = false
}
func textFieldShouldReturn(textField: UITextField!) -> Bool {
self.view.endEditing(true)
return false
}
I want the entered text of the emailTextField
field to reappear once I navigate back to the login page from the splash screen. The splash screen is sent back to the login page by a UIButton via a push segue which is clearing any previous text that was entered.
I need to save the entered text as an object and then load it again after I navigate to the login page from the splash screen.
How would I do that?