Check out example codes for "swift uialertcontroller textfield". It will help you in understanding the concepts better.
Code Example 1
alert.addTextField { (textField) in
textField.placeholder = "Enter First Name"
}
Learn ReactJs, React Native from akashmittal.com