iphone - how can I dismiss keyboard when I will just touch anywhere except UITextField? -


hello have 2 uitextfields in application, , want dismiss keyboard when touch anywhere except uitextfields how can this?

use tochesbegin method purpose

- (void)touchesbegan:(nsset *)touches withevent:(uievent *)event {    [yourfirsttextfield resignfirstresponder];   [yoursecondtextfield resignfirstresponder]; } 

you not need thing else.when touch anywhere on view both textfield resign no need to know 1 having focus.and when touch textfield textfield open keyboard own.


Comments

Popular posts from this blog

forms - Secure PHP File Upload Script -

PHP: Exploding array elements -

reflection - How to use FxCop CustomDictionary.xml from the project localization? -