Is it possible to redirect the becomeFirstResponder
from self to a subview?
Here is my scenario.
I create a new UIWindow
, let's call it secWin
, object with a UINavigationController
, let's call it navCon
, as the rootViewController
.
navCon
has a custom UIViewController
, let's call it cusViewCon
, as rootViewController
which contains only a single UITextField
.
Now when i press a button in my main window, i call [secWin makeKeyAndVisible]
, which successfully shows the new window.
But now i want the UITextField
to show the keyboard any time cusViewCon
gets a becomeFirstResponder
call, which is e.g. done by iOS by default when calling [secWin makeKeyAndVisible]
.
I tried to do all this by simply overwrite becomeFirstResponder
in my cusViewCon
class like this:
- (BOOL)becomeFirstResponder {
[_myTextField becomeFirstResponder];
return NO;
}
It is working, but i don't know if it is the correct way to do so, because in the documentation it says:
You can override this method in your custom responders to update your object's state or perform some action such as highlighting the selection. If you override this method, you must call super at some point in your implementation.