This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ViewController: UIViewController { | |
| var textField: UITextField? | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Setup the textField |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension ViewController: UITextFieldDelegate { | |
| // Called when the user clicks return | |
| func textFieldShouldReturn(_ textField: UITextField) -> Bool { | |
| // Make keyboard disappear | |
| textField.resignFirstResponder() | |
| return true | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Setup the textField delegate so that the keyboard will show once clicked | |
| textField?.delegate = self |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ViewController: UIViewController { | |
| var textField: UITextField? | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Setup the textField |
NewerOlder