Disable Segmented Control

Hello,

I want that if the Switch is on that the Segmented Control is disabled. How can I do that? Thank you!

I assume you have defined an IBOutlet for the segmentedControl

     @IBOutlet weak var segmented : UISegmentedControl!

In the IBAction of the switch:

     @IBAction func changeSwitch(_ sender: UISwitch) {
        // Some code
          segmented.isEnabled = !sender.isOn
     }
Disable Segmented Control
 
 
Q