Created
June 30, 2016 02:33
-
-
Save openopen114/2184656357758562aed9947186cbeaf4 to your computer and use it in GitHub Desktop.
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
//class need add : UITextFieldDelegate | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
//delegate | |
discountTextField.delegate = self | |
sizeTextField.delegate = self | |
//add gesture to view | |
self.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(InvCalcViewController.dismissKeyboard))) | |
} | |
// dismiss keyboard function | |
func dismissKeyboard(){ | |
sizeTextField.resignFirstResponder() | |
discountTextField.resignFirstResponder() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment