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 


}

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift