Why are not accessibilityDecrement() and accessibilityIncrement() getting called in my custom UITextView when performing the appropriate gestures?
class CustomTextView: UITextView {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
accessibilityTraits = accessibilityTraits | UIAccessibilityTraitAdjustable
}
override func accessibilityDecrement() {
print("Decrement")
}
override func accessibilityIncrement() {
print("Increment")
}
}
Try with:
My bad. Turns out I had forgotten that I was setting textView.accessibilityTraits = UIAccessibilityTraitStaticText in the ViewController.viewDidLoad. Duhh...