I used to use XCode the develop my apps and using that; I could create a link up in IB/Storyboard that synthesized this methods:
- (void)addTarget:(id)target action:(SEL)action forControlEvents: (UIControlEvents)controlEvents
for when
However, no I'm doing it all programmatically (in rubymotion, though not necessarily relevant) and looking into the documentation for UITextField I found some delegate methods, which I implemented as follows:
def textFieldShouldReturn(text_field)
text_field.resignFirstResponder
end
def textFieldShouldEndEditing(text_field)
# this is for validations; don't set a first responder here
true
end
def textFieldDidEndEditing(text_field)
text_field == @email_field ? @password_field.becomeFirstResponder : delegate.validate_login_info
end
But using this, I found that I could not tab through the input fields (of which I have two; email and password) as I could before with the addTarget approach.
What is the difference between these two approaches? Does the former implement the latter behind the scenes? I don't understand why one will allow me to tab through and the other won't. Did I just implement the delegate methods differently than the target/action approach does behind the scenes?
Feedback appreciated, pachun