Skip to content

Instantly share code, notes, and snippets.

View EricGustin's full-sized avatar
🌎
I wonder how long my GitHub status can be before it tells me that I can't type a

Eric Gustin EricGustin

🌎
I wonder how long my GitHub status can be before it tells me that I can't type a
View GitHub Profile
import UIKit
class ViewController: UIViewController {
var textField: UITextField?
override func viewDidLoad() {
super.viewDidLoad()
// Setup the textField
extension ViewController: UITextFieldDelegate {
// Called when the user clicks return
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
// Make keyboard disappear
textField.resignFirstResponder()
return true
}
}
// Setup the textField delegate so that the keyboard will show once clicked
textField?.delegate = self
import UIKit
class ViewController: UIViewController {
var textField: UITextField?
override func viewDidLoad() {
super.viewDidLoad()
// Setup the textField