How can I add a UITapGestureRecognizer to a UITextView but still have the touches getting through to the UITextView as normal?
Cur
Swift 4.2
The following steps allows me to escape a full-screen UITextView with a tap, whilst allowing to scroll the contents of the UITextView:
class CustomTextView: UITextView {
var sender: DocViewController?
override func touchesEnded(_ touches: Set, with event: UIEvent?) {
if let controller = sender {
controller.handleSwipeGesture()
}
}
}
I can either scroll the contents of the UITextView or merely tap to exit.
The 'sender' is set from the hosting UIViewController at creation.