Created
August 7, 2020 06:54
-
-
Save akio0911/9676b93e7e274a588afa4a1ebdf1115d to your computer and use it in GitHub Desktop.
This file contains 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 { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let tapGestureRecognizer = UITapGestureRecognizer( | |
target: self, | |
action: #selector(ViewController.didTapView) | |
) | |
view.addGestureRecognizer(tapGestureRecognizer) | |
} | |
@objc func didTapView() { | |
view.endEditing(true) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment