Frederik Norlyk Eriksen Frederik Norlyk Eriksen - 1 year ago 143
Swift Question

Swift detect return key pressed without using textFieldDidEndEditing

Is there a way to detect that the return key was pressed on the keyboard without using

is also triggered if you for example perform a segue which dismisses the keyboard.

Answer Source

Below delegate is called when you press return key.

func textFieldShouldReturn(textField: UITextField) -> Bool {
    print("return pressed")
    return false
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download