How to create a segmented control and add the action to that and handle iOS swift?
Solution:
First drag and drop the segmented control to your storyboard.
Then add the action to the segmented control with value changed option.
Then add the code inside the action.
How many number of segments you had based on that you can add the cases in that.
Code:
switch segmentControl.selectedSegmentIndex {
case 0:
break
case 1:
break
default:
break
}
First drag and drop the segmented control to your storyboard.
Then add the action to the segmented control with value changed option.
Then add the code inside the action.
How many number of segments you had based on that you can add the cases in that.
Code:
switch segmentControl.selectedSegmentIndex {
case 0:
break
case 1:
break
default:
break
}
Comments
Post a Comment