(iOS8, Xcode6, Swift) Using Swift, how do I capture a tap on the \"Return\" button?
The doc at the following link specifies using the textFieldShouldReturn
Implement this function
func textFieldShouldReturn(_ textField: UITextField) -> Bool { //delegate method
textField.resignFirstResponder()
return true
}
And for delegate you can set using the Utilities pane / Connections Inspector / delegate and then drag to ViewController (yellow button in the storyboard)
Then you do not need to set the delegate programmatically for every text field