Becomefirstresponder Not Working in iOS 8

becomeFirstResponder not working in iOS 8

Try calling becomeFirstResponder like below

[txtAddNew performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0];

As per Apple,

A responder object only becomes the first responder if the current
responder can resign first-responder status (canResignFirstResponder)
and the new responder can become first responder.

You may call this method to make a responder object such as a view the
first responder. However, you should only call it on that view if it
is part of a view hierarchy. If the view’s window property holds a
UIWindow object, it has been installed in a view hierarchy; if it
returns nil, the view is detached from any hierarchy.

becomeFirstResponder not show keyboard in ios 11

It's really weird, because this issue can be fixed after showing a UIAlertView
So when I try to add a UIAlertView with loading indicator (and auto dimiss after few seconds) like this before showing keyboard with above code, it can work well.

Don't know the root cause of my project, but it works.

And it only happens on ios 11.



Related Topics



Leave a reply



Submit