Liquid glass segmented control freezes when dragging handle to a disabled segment

1 week ago 6
ARTICLE AD BOX

Setup:

I have a segment view with 3 segments, and the last one (at index 2) is disabled.

Issue:

When I drag the liquid glass handle of the segment view from what was previously selected to the disabled segment, the liquid glass handle freezes mid-air.

segmented-control-freeze-image

Workaround: I can still interact with the handle and manually restore its position, or tap on any other segment to restore its position.

Notes: I'm using UIKit, and no extra customizations are applied.

class ViewController: UIViewController { @IBOutlet weak var segmentView: UISegmentedControl! override func viewDidLoad() { super.viewDidLoad() segmentView.removeAllSegments() let segments = ["Option 1", "Option 2", "Option 3"] for (index, title) in segments.enumerated() { segmentView.insertSegment(withTitle: title, at: index, animated: false) } // Select the first one by default segmentView.selectedSegmentIndex = 0 // Disable the last segment segmentView.setEnabled(false, forSegmentAt: 2) } }

Apple Developer Forum link

Read Entire Article