TTSegmentedControl
TTSegmentedControl copied to clipboard
selectItemAt does not move the thumb
.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
Works for me:
segmentedControl.didSelectItemWith = { (index, title) in if index == 0 { self.modeOfTableView = false } else { self.modeOfTableView = true } self.tableView.reloadData() }
simulator might have some lags.
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?
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.