Swift : Dismiss keyboard

// MARK: Hide keyboard
    
    override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
        view.endEditing(true)
        super.touchesBegan(touches, withEvent: event)
    }
    
    // MARK: UITextFieldDelegate
    
    func textFieldShouldReturn(textField: UITextField) -> Bool {
        tfInput.resignFirstResponder()
        return false

    }

Popular posts from this blog

Center Scrollview Swift iOS

PNScanner - Privacy Policy