title: Detecting when back button is tapped in navigation bar
body: <p>I need to <code>resignFirstResponder()</code> on a text field when the user taps the back button in the navigation bar of the navigation controller, otherwise I get some error. The back button works as it should (the previous view gets shown) but I don't know where to do resign first responder. It's too late if I do it in <code>viewWillDisappear()</code> (I tried), and <code>prepareForSegue()</code> doesn't get called, so I need to somehow do it as soon as the back button gets tapped or at least before <code>viewWillDisappear()</code>. How do I detect that event?</p>