Search code examples
iosuikituisegmentedcontrol

UISegmentedControl change number of segments programmatically


Is there a way to change the number of segments programmatically?


Solution

  • Yes, you can use

    removeSegmentAtIndex:(NSUInteger) animated:(BOOL)
    

    And

    insertSegmentWithTitle:(NSString *) atIndex:(NSUInteger) animated:(BOOL)