Switch from one textField to another TextField when giving it to continue on the IOS keyboard

0

How can I go from textfield to other textfield by hitting the continue button on the keyboard of ios ??

I've tried with @IBAction but it only works for me if I change manually from textfield

    
asked by 03.10.2016 в 11:04
source

1 answer

1

It is not possible to do it automatically. The best way is to implement the following delegated method:

textFieldShouldReturn(_:)

In it, detect what textField is the current, and make the next textField become the asset with:

textField.becomeFirstResponder()

If you need to know the order and which one you are in at that moment, use the delegate method textFieldDidBeginEditing(_:) and assign a tag of order to each textField so that if you are in tag 3 the next one is the 4

    
answered by 03.10.2016 / 11:10
source