Let you have a text filed and a button in a view. if you pressed the button something will happen.
Now if you click or select the text field a keyboard will appear. now if you press the return key of the keyboard this will not disappear. If you want to make it disappear in the time of clicking on the button just add the following code in the action function of the button.
where inputTextField is the object which is mapped with the textfield of the view.
Now when you click on the button keyboard will disappear.
Now if you want to enable return button of the keyboard (keyboard will disappear when return key will be pressed) you have to do the following.
edit the viewController header(.h) file. Specify the textfield deligate after the declaration of interface as bellow:
@interface DialerViewController : UIViewController< UITextFieldDelegate>
Now add the following function to your viewController.m file
your textFiled keyboard type should be UIKeyboardTypeNumbersAndPunctuation or any type that shows return button in keyboar view. so when you click on the return button this function will be called.
Now what if you want to show only nuberpad and what has no return button. Then how you dismiss or hide the keypad? In my next post I will show how to do that.