MMM
0
Q:

UITextFieldDelegate

class ViewController: UIViewController,UITextFieldDelegate  //set delegate to class 

@IBOutlet var txtValue: UITextField             //create a textfile variable 

override func viewDidLoad() {
    super.viewDidLoad()
    txtValue.delegate = self                  //set delegate to textfile
}


func textFieldDidBeginEditing(textField: UITextField!) {    //delegate method

}

func textFieldShouldEndEditing(textField: UITextField!) -> Bool {  //delegate method
    return false
}

func textFieldShouldReturn(textField: UITextField!) -> Bool {   //delegate method
  textField.resignFirstResponder()

    return true
}
0

New to Communities?

Join the community