I have a UISwitch element which shows a alert view controller on toggle.
UISwitch *element = [[UISwitch alloc] initWithFrame:CGRectZero];
[element addTarget:self action:@selector(doSomething:) forControlEvents:UIControlEventValueChanged];
-(void)doSomething:(UISwitch *)switch
{
// show alert view controller
}
After switching the toggle, if I hold on to the UISwitch control and not release my fingers, even though the alert view is been shown, I'm still able to switch between ON and OFF. Is there any way we can relinquish control of the UISwitch element while the user hasn't released his finger yet. I'd like to give up control of the switch on receiving the first UIControlEventValueChanged event?