Specifying UISegmentedControlNoSegment to UISegmentedControl's selectedSegmentIndex has no Effect on iOS 13
The solutions given in the other answers are overblown. There is a much simpler workaround: just call setNeedsLayout
on the segmented control.
self.seg.selectedSegmentIndex = UISegmentedControl.noSegment
self.seg.setNeedsLayout()