Frederik Norlyk Eriksen Frederik Norlyk Eriksen - 11 months ago 82
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