Reputation: 12287
I simply wanted to do something like this:
class UITouchyGestureRecognizer: UILongPressGestureRecognizer {
required init? .. something .. {
super.init .. who knows ..
print("wth?")
minimumPressDuration = 0
}
}
But I have completely given up because I've tried about 20 ways and can't get it.
How to?
Upvotes: 0
Views: 97
Reputation: 3402
The simplest subclass would be:
class UITouchyGestureRecognizer: UILongPressGestureRecognizer {
override init(target: Any?, action: Selector?) {
super.init(target: target, action: action)
minimumPressDuration = 0
}
}
But if you want to use init(coder...) and then .addTarget(target: Any, action:Selector)
class UITouchyGestureRecognizer: UILongPressGestureRecognizer {
required init?(coder aDecoder: NSCoder) {
super.init(target: nil, action: nil)
print("wth?")
minimumPressDuration = 0
}
}
Upvotes: 3