swift uialertcontroller textfield

Swift
alert.addTextField { (textField) in
    textField.placeholder = "Enter First Name"
}
Source

Also in Swift: