サブクラスを作る
説明
delaysContentTouches
遅延させるか?
A Boolean value that determines whether the scroll view delays the handling of touch-down gestures
touchesShouldCancel(in view: UIView) -> Bool
ドラッグしだしたらキャンセルするか?
Returns whether to cancel touches related to the content subview and start dragging.
class NoTapDelayScrollView: UIScrollView {
override init(frame: CGRect) {
super.init(frame: frame)
delaysContentTouches = false
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
delaysContentTouches = false
}
override func touchesShouldCancel(in view: UIView) -> Bool {
return true
}
}