I'm wanting to change my label "teamNameLabel" whenever a user inputs text into my textfield from AlertController and hit's the ENTER button.
I'm really close. I just need the text once entered to display as my label when the hit the ENTER button.
ALSO: Is there anyway to make the text entered into my textfield CAPITALS ONLY? (eg. User has to enter "TEAM NAME" and not "team name")
See code and images below:
@IBAction func editTeamNameButton() {
let message = "Please Enter Below"
let alert = UIAlertController(title: "ENTER TEAM NAME", message: message, preferredStyle: .alert)
let action = UIAlertAction(title: "ENTER", style: .default, handler: nil)
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
alert.addAction(action)
alert.addAction(cancelAction)
alert.preferredAction = action
alert.addTextField(configurationHandler: { (textField) in
textField.placeholder = "Eg. TEAM NAME"
})
present(alert, animated: true, completion: nil)
}