In our applications, we have an Undo button in our main view controller’s navigation bar. This button is supposed to do two things:
If there is a text field being edited, it should undo in the text field’s undo stack.
Otherwise, it should undo in the document’s undo stack.
Unfortunately, dismissing the keyboard clears out the window’s first responder, which means the
-undo: message never makes it to the view controller.