Rony
Rony

Reputation: 1229

Toggle two UISwitch

I have two UISwitch....and i need to turn off the first one when the second one is turn on and also turn on the first one when the second one is off....

similarly when first is on second will go off and vice varca...

any idea??

Upvotes: 2

Views: 738

Answers (1)

willcodejavaforfood
willcodejavaforfood

Reputation: 44053

Add an IBAction for both switches

- (IBAction)toggleForFirstSwitch
{
    [secondSwitch setOn:!firstSwitch.on animated:YES];
}

- (IBAction)toggleForSecondSwitch
{
    [firstSwitch setOn:!secondSwitch.on animated:YES];
}

or something like that anyway :)

Upvotes: 2

Related Questions