objective c - Call a function on a touch outside of the active UITextField -
objective c - Call a function on a touch outside of the active UITextField -
how phone call custom function when user touches outside of uitextfield has keyboard focus?
my goal phone call function textfield validation.
i tried this:
// dismiss keyboard - (void)touchesended: (nsset *)touches withevent: (uievent *)event { (uiview* view in self.view.subviews) { if ([view iskindofclass:[uitextfield class]]) { [view resignfirstresponder]; [self validationfornoofpassengers]; } } }
validationfornoofpassengers
method check validation. problem here when tap on other ui controls not phone call above method. above method called when touched outside on screen (but not on uicontrols). guidance?
set view controller (or other object) text field's delegate. validation in -textfieldshouldendediting:
or -textfielddidendediting:
.
objective-c ios focus uitextfield
Comments
Post a Comment