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
Post a Comment