Thursday, October 29, 2015

UI With Text Field Checklist

Keyboard Return Key
    - Set UITextField delegate in the main storyboard
    - implement the protocol UITextFieldDelegate or UITextViewDelegate in the view controller
    - override the function 
    func textFieldShouldReturn(textField: UITextField) -> Bool

 Dismiss Keyboard on Background Tap
    - Change the view class from UIView to UIControl
    - Allow User Interaction should be checked
    - Create an action touch down on the UIControl
    - On the action for touch down, invoke:
    @IBAction func backgroundTouchDown(sender: AnyObject) {
        view.endEditing(true)
    }


No comments:

Post a Comment