import UIKit
class ViewController: UIViewController, UITextFieldDelegate {
@IBOutlet var myTextField : UITextField
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.myTextField.delegate = self;
}
func textFieldShouldClear(_ textField: UITextField) -> Bool // called when 'return' key pressed. return false to ignore.
{
textField.resignFirstResponder()
return true
}
}
Thursday, 27 April 2017
How to hide keyboard in swift on pressing return key?
Subscribe to:
Post Comments (Atom)
Remove bottom line in navigation bar
navigationController ?. navigationBar . setBackgroundImage ( UIImage (), for: . any , barMetrics: . default ) navigat...
-
--> Use this line for getting device name UIDevice.current.name ------------------------------------------------------------------...
-
For Label: labelname.attributedText = NSAttributedString(string: "text " , attributes: [NSUnderlineStyleAttribut...
-
// Reading data from Local Json file instead of Service urls using Alamofire in swift3 func getwordmeaningdata() { ...
No comments:
Post a Comment