How can I turn a switch off inside a different switch? Here's an example - When the isMale switch is turned on, turn off the isFemale switch.
- (IBAction)isMale:(id)sender {
if ([sender isOn]) {
//TURN isFemale SWITCH OFF
}
else {
...
}
}
and
- (IBAction)isFemale:(id)sender {
if ([sender isOn]) {
//TURN isMale SWITCH OFF
}
else {
...
}
}
I've been reading the Apple development docs but cannot find anything about changing a switch inside another switch. Cheers.
first of all you need to create
IBOutlet
of bothUISwitch
in your header.h
filethen in your
IBAction
do as follow.remember to connect both of your
IBOutlet
to respective objects in yourUIViewController
.