Change value of segmented control?

How to change the value of a segmented control using code?

+3
source share
3 answers
UISegmentedControl *cont;
.....
cont.selectedSegmentIndex = 4; //Selected index you want;
+15
source
[segmentedControl setSelectedSegmentIndex:(NSInteger)]
+5
source

You can change the segment control value using the property selectedSegmentIndex

For example. segmentedControlObject.selectedSegmentIndex=1;

In the tutorial you can link this

0
source

Source: https://habr.com/ru/post/1786219/


All Articles