let alert = UIAlertController(title: "Title", message: nil, preferredStyle: .alert)
alert.addTextField { (textField) in
textField.placeholder = "Name"
}
let action = UIAlertAction(title: "Save", style: .default) { (_) in
}
let cancel = UIAlertAction(title: "Cancel", style: .cancel) { (action: UIAlertAction) in
}
alert.addAction(action)
alert.addAction(cancel)
present(alert, animated: true, completion: nil)