Skip to content

Can't drag thumb icon when displayed inside formsheet (iOS 13) #13

@kfound

Description

@kfound

Formsheets in iOS13 introduced the ability to drag the sheet down to dismiss it. This causes a problem with the GradientSlider where you can't drag the slider very far - it stutters and you'll see a call to cancelTracking invoked for seemingly no reason. If the GradientSlider is displayed in a popover; it works fine.

To fix the issue, you need to add code into the GradientSlider to ignore a UIPanGestureRecognizer:

override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
        if gestureRecognizer is UIPanGestureRecognizer {
            return false
        }
        return true
}

You might also want to check isTracking == true but I found it didn't matter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions