I'm running this code within a ViewController class that contains UIViewController and SettingsViewDelegate. The View Controller scene contains a text view that has a scroll bar.
@IBOutlet weak var tvEditor: UITextView! override func viewDidLoad() { super.viewDidLoad() // Hide keyboard via swipeDownGestureRecognizer. let swipeGesture: UISwipeGestureRecognizer = UISwipeGestureRecognizer (target: self, action: "hideKeyboard") swipeGesture.cancelsTouchesInView = false UISwipeGestureRecognizerDirection.Down } func hideKeyboard() { tvEditor.resignFirstResponder() } When I run my project in the iOS Simulator/device, the keyboard does not respond to a downward swipe. I change the orientation of my device to landscape, and then back to portrait, which is when the keyboard disappears. Can someone please tell me where I'm going wrong?
swipeGestureto any view.