Reputation: 51
I am using dynamic segmented control. Whenever user adds new decks, the title is showing up in the segmented control.
However, I need a horizontally scrollable segmented controller that might have different title width depending on the text (title) size.
Upvotes: 1
Views: 451
Reputation: 51
this helped me to achieve it. iOS 13 Segmented Control: Remove swipe gesture to select segment
I added my segmented controller inside of scroll view. Then changed my segmented controller class to the following;
class NoSwipeSegmentedControl: UISegmentedControl {
override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}
Upvotes: 1