Open WAUnique opened 8 years ago
Hey @weuniq! First of all thanks for the issue 🎉 and sorry for getting so late back to you. 🙇
Your task would need disabling UIScrollView
scrolling, but as of now the scrollView
property of SwiftCarousel
is a private one. And because of safety I really want it to stay private, although we can make a method that would replace current scrolling gesture with a custom one defined by user.
The implementation could look like the one below:
private var customGestureRecognizer: UIGestureRecognizer?
public func replaceDefaultGesture(withGesture gestureRecognizer: UIGestureRecognizer) {
scrollView.scrollEnabled = false
customGestureRecognizer = gestureRecognizer
addGestureRecognizer(customGestureRecognizer)
}
public func restoreDefaultGesture() {
guard let customGestureRecognizer = customGestureRecognizer else { return }
removeGestureRecognizer(customGestureRecognizer)
scrollView.scrollEnabled = true
}
Please let me know if you would be up for adding this in a PR to SwiftCarousel
. Don't feel pressured tho! I can do this for you :bow:
Hi! I want to disable Gesture Recognizer in SwiftCarousel built-in and create custom Gesture. But I don't know how to disable that. Please help. Thank you