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
Link to Safari "Add to Home Screen" from Inside App
iOS Searchdisplaycontroller Prevents Tableview from Background Color Change (Background Stays Gray)
How to Pass Swift Enum with @Objc Tag
How to Set Selected Segment Index in Uisegmentedcontrol
Alamofire No Such Module (Cocoapods)
Uiscrollview Not Scrolling Regardless of Large Contentsize
Launching Phone/Email/Map Links in Wkwebview
Uitapgesturerecognizer Programmatically Trigger a Tap in My View
Becomefirstresponder Not Working in iOS 8
Core Data Store Included in App Bundle
How to Customize Uirefreshcontrol with Different Image and Position
Ios: Does Force Quitting the App Disables Background Upload Using Nsurlsession
Uilocalnotification Isn't Working at All
How to Loop Video with Avplayerlooper
Swiftui in iOS14 Keyboard Avoidance Issues and Ignoressafearea Modifier Issues