xcode get info from text field
let text = myTextField.text
xcode how to know which textfield is selected
class ViewController : UIViewController, UITextFieldDelegate {
var activeTextField = UITextField()
// Assign the newly active text field to your activeTextField variable
func textFieldDidBeginEditing(textField: UITextField) {
self.activeTextField = textField
}
// Call activeTextField whenever you need to
func anotherMethod() {
// self.activeTextField.text is an optional, we safely unwrap it here
if let activeTextFieldText = self.activeTextField.text {
print("Active text field's text: \(activeTextFieldText)")
return;
}
print("Active text field is empty")
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us