I\'m trying to show changes made to a UITextField on a separate UILabel. Is there a way to capture full text of the UITextField after
In Swift 3.0:
Some of these solutions were one character behind, or for earlier versions of Swift and Obj-C. Here is what I am using for Swift 3.0
In the class I declared a placeholder to store the text.
var tempName = ""
In ViewDidLoad I used:
nameField.addTarget(self, action: #selector(typingName), for: .editingChanged)
Then I made a function called:
func typingName(textField:UITextField){
if let typedText = textField.text {
tempName = typedText
print(tempName)
}
}