I am new to apple Swift.I am trying to build a demo app based on this tutorial. I have found that the app is not working. After several trial and fails, I have found that if I change the line of code:
func textFieldDidEndEditing(textField: UITextField) {
to
func textFieldDidEndEditing(_ textField: UITextField) {
I am able to run the code properly.
I want to know what happens by adding the _ as one of the arguments. Both of the two methods will not result in compilation errors. But the first one does give warnings like:
ViewController.swift:35:10: Instance method 'textFieldDidEndEditing(textField:)'
nearly matches optional requirement 'textFieldDidEndEditing' of protocol 'UITextFieldDelegate'
Since the first one is given by apple tutorial, I am not sure whether it is a mistake. Can somebody clarify my doubts?