SCLAlertView-Swift
SCLAlertView-Swift copied to clipboard
Is there a way to have an added text field become first responder on show?
I've tried telling the textfield I added to become first responder before show but that doesn't quite work as the alert view misses the notification and is occluded by the keyboard.
I've but the .becomeFirstResponder() call after the .showInfo() call and it works - at least in the simulator.
I've made the becomeFirstResponder() call after showInfo() and the keyboard is still appearing over the view. Any idea what's going on? (The UITextField is a subview of a customSubview).
let text = alert.addTextField("Descrição") text.becomeFirstResponder()
I did this, before calling showEdit... and worked....
try this
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
textView.becomeFirstResponder()
}