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

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -