who is currently the first responder? (iOS)
who is currently the first responder? (iOS)
- Subject: who is currently the first responder? (iOS)
- From: Roland King <email@hidden>
- Date: Wed, 29 Jun 2011 21:12:50 +0800
Is there a way to find out what UIResponder is the current first responder, the one with the keyboard up?
I have a number of editable fields, each on a cell of a table view which is in a UIViewController managed by a UINavigationController. There's a couple of other editable fields on there too, in the top bar. If the user hits the back button, or a button which pushes a new UIViewController on the stack or initiates some other view transition whilst one of those things is being edited, I want to make the edit commit before I leave the screen to get the model object in a consistent state. To do that I need to tell the first responder to resign, if I can figure out what it is.
I didn't particularly want to iterate all the fields which could be onscreen or all the views in the hierarchy and tell them all to resign. Is there a way to find the current first responder?
I did wonder about just telling the UIApplication itself to become, and then resign, first responder, but that doesn't feel quite right. _______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden