TTSegmentedControl icon indicating copy to clipboard operation
TTSegmentedControl copied to clipboard

selectItemAt does not move the thumb

Open RaphaelLesourd opened this issue 5 years ago • 4 comments

.selectItemAt(index: 0, animated: true) does not make the thumb move when you try to set the position programmatically. is there another way?? thank you

RaphaelLesourd avatar Feb 05 '20 12:02 RaphaelLesourd

Works for me:

segmentedControl.didSelectItemWith = { (index, title) in if index == 0 { self.modeOfTableView = false } else { self.modeOfTableView = true } self.tableView.reloadData() }

IhorChernysh avatar Feb 25 '20 10:02 IhorChernysh

simulator might have some lags.

alextud avatar Jun 06 '20 14:06 alextud

If I select item programmatically by using selectItemAt(index: 0, animated: false), the thumb is not moving to the selected item.

Is there a way to move the thumb?

pradipaub36 avatar Aug 12 '22 10:08 pradipaub36

For some reason when I am calling .selectItemAt(..) programmatically it works like it should and sometimes it does not move the thumb. Also when dismissing my app to background and opening it again, the selected index is changed back to the initial value, like the desired index was not stored when calling .selectItemAt(..) programmatically, had to observe didBecomeActive to make it stick to the index I set programmatically.

alexanderludvigs avatar Nov 08 '22 16:11 alexanderludvigs