okmr-d / DOAlertController

Simple Alert View written in Swift, which can be used as a UIAlertController. (AlertController/AlertView/ActionSheet)
MIT License
405 stars 68 forks source link

how to make textfield as first responder? #14

Closed kohdesmond closed 8 years ago

kohdesmond commented 9 years ago

Hi,

Just wondering how to make textfield as first responder?

Cheers

carlosa54 commented 8 years ago
let exampleController = DOAlertController(title: "Example", message: "This is an example", preferredStyle: .Alert)

This will make the textfield become the first responder when exampleController is presented

exampleController.addTextFieldWithConfigurationHandler( {(textField: UITextField!) in
                        textField.becomeFirstResponder()
                })