© 2013 All rights reserved.

UITextFields: event click to "Return key" on keyboard

The keyboard includes a “return key”, which can be linked to any action, such as moving to the next field on the form, this we can do with overload function textFieldShouldReturn.

Often we have a group of text fields and want to be able to switch from one to the next using the keyboard.




1. Create interface in h file

Inteface define properties and must contain UITextFieldDelegate as delegate class.

Set delegate in Xib file

When we created UITextFields in the header file, you can connect with XIB file.

What is important: you need to set element delegate to File’s Owner.




Overload function textFieldShouldReturn

Setting options of “Return key”



Comments are closed for this page

Hi, i am programmer from the Czech Republic. I love web development (Ruby, Ruby on Rails, PHP, Nette) and iOS development (Objective-C, Cocoa).
To cooperate, here is my phone:
+420 608 836