I have multiple textfields on my page. I know I can select them through the textFieldShouldReturn
method. The design I'm trying to implement uses a UIToolbar
as an inputAccessoryView
which I've seen in a lot of apps. I've created the toolbar as you can see in the image with '<' '>' and 'Done' buttons. I've created a function that will be called for each bar button item.
The sticky point for me is to figure out which textfield is currently active and controls the keyboard. Depending upon which textfield it is I want to perform custom method for the 'Done' button. I tried to refer figure out the tag of the view that sends me to the method but with no luck. What should my approach be to get past this issue? Any relevant insights or suggestions are welcome
Okay I've sorted this out. I've used the textFieldDidBeginEditing
method to store a reference to the tag of the currently active textField. Within the bar button item function I just refer to the current tag of the active textField and make the textField
with the next tag as the FirstResponder.
Hope this helps someone