I have multiple instances of a custom class that takes inputs from keyboard. You can think of UITextField
(but they are not UITextField
, they are NSObject
). However, they all have a property UIControl *control
.
These objects are instantiated and put into an array (orders matter), and they are put on the screen in the same order.
Scenario 1: User tabs on the first object, it becomes the first responder. User taps on another object (from the same class) and that becomes the first responder. No problem.
Scenario 2: User tabs on the first object, it becomes the first responder. User taps on the TAB
button of the keyboard (iPad or iPhone or wireless keyboard), I want the next object in the array becomes the next responder. iOS picks randomly [? or with some logic not clear to me] another object which is not in the same order as I want.
Problem: Because these objects are NSObject
s, how can I intercept the transition to the next object. I tried using tags or tracking who is the first responder, but the problem is, if user taps on an object out of order, it is fine - I don't want to intercept that. I only want to intercept transition from one object to anther only if it is through tapping on TAB
(or Next
or Return
) button of keyboard.
Any idea? Thanks.