Skip to content

Instantly share code, notes, and snippets.

@Amir-P
Created September 15, 2016 10:39
Show Gist options
  • Save Amir-P/e1140eb069b6690fb7f01794b69e6d4b to your computer and use it in GitHub Desktop.
Save Amir-P/e1140eb069b6690fb7f01794b69e6d4b to your computer and use it in GitHub Desktop.
override func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: NSNotification.Name(rawValue: "keyboardWillShow") , object: NSNotification.Name.UIKeyboardWillShow)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: NSNotification.Name(rawValue: "keyboardWillHide"), object: NSNotification.Name.UIKeyboardWillHide)
hideKeyboardWhenTappedAround()
if let username = defaults.string(forKey: "doc_username") {
if let password = defaults.string(forKey: "doc_password"){
login_password.text = password
login_username.text = username
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment