• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
who is currently the first responder? (iOS)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Fuzzy string matching
  • Next by Date: Re: Fuzzy string matching
  • Previous by thread: RE: Fuzzy string matching
  • Next by thread: Re: who is currently the first responder? (iOS)
  • Index(es):
    • Date
    • Thread