TOSegmentedControl icon indicating copy to clipboard operation
TOSegmentedControl copied to clipboard

Manually setting `selectedSegmentIndex` doesn't update the UI

Open DantePuglisi opened this issue 5 years ago • 2 comments

It's quite unintuitive (and undocumented) that by doing: segmentedControl.selectedSegmentIndex = 0 nothing happens in the UI (actually something happens but it's quite glitchy) and the way it works is by doing segmentedControl.setSelectedSegmentIndex(0, animated: true)

Is this on purpose?

DantePuglisi avatar Oct 30 '20 19:10 DantePuglisi

Nope, it's not on purpose.

If we're talking about things being unintuitive, what do you mean by "something happens but it's quite glitchy"? 😜

TimOliver avatar Oct 31 '20 04:10 TimOliver

I thought maybe it was on purpose that's why I made that comment 🙈. So if you do segmentedControl.selectedSegmentIndex = 0 the selectedSegmentedIndex gets changed but it's not shown on the UI (UI doesn't change accordingly)

DantePuglisi avatar Nov 06 '20 21:11 DantePuglisi