I’m building a MonoTouch iPhone app, but have come up with a small issue.
I have a view with 2 UITextFields for login (username/password), however when I first tap on a field, it pops up the keyboard, and the keyboard never disappears again.
The problem is the keyboard hides my “Login” button, so the user cannot tap it.
I’d like the keyboard to resign if I tap anywhere on the “background” of my view.
So I figured out I can do that in TouchesEnded on my UIViewController – however to resign the keyboard I need a reference to the current UIView being FirstResponder.
Which finally leads to my question: Can I find out which UIView is currently FirstResponder without looping recursively through all views from my UIViewController ?
You can use