Skip to content

Instantly share code, notes, and snippets.

@angelsystem
Created November 5, 2014 04:55
Show Gist options
  • Save angelsystem/cd56109b46f3fb3bacac to your computer and use it in GitHub Desktop.
Save angelsystem/cd56109b46f3fb3bacac to your computer and use it in GitHub Desktop.
keyboard hide button return
import UIKit
class ViewController: UIViewController, UITextFieldDelegate {
@IBOutlet var password: UITextField! //create a delegate in storyboard with viewcontroller and textfield
func textFieldShouldReturn(textField: UITextField) -> Bool {
password.resignFirstResponder()
return true
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment