SCLAlertView-Swift icon indicating copy to clipboard operation
SCLAlertView-Swift copied to clipboard

Is there a way to have an added text field become first responder on show?

Open jhoughjr opened this issue 8 years ago • 4 comments

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.

jhoughjr avatar Feb 20 '17 18:02 jhoughjr

I've but the .becomeFirstResponder() call after the .showInfo() call and it works - at least in the simulator.

dploeger avatar Mar 20 '17 20:03 dploeger

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).

SangSaephan avatar Sep 26 '17 09:09 SangSaephan

let text = alert.addTextField("Descrição") text.becomeFirstResponder()

I did this, before calling showEdit... and worked....

Cleversou1983 avatar Jan 21 '18 13:01 Cleversou1983

try this

DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
            textView.becomeFirstResponder()
        }

uddinr avatar Nov 09 '20 21:11 uddinr