I have a button that I would like both its Touch Up Inside and Touch Up Outside actions to all the same method. I then want the method to sort out which event happened, something like this:
- (IBAction)buttonMethod:(UIButton *)sender forEvent:(UIEvent *)event {
if (event == UIControlEventTouchUpInside)
NSLog(@"Touch up inside!");
if (event == UIControlEventTouchUpOutside)
NSLog(@"Touch up outside!");
}
}
This doesn't seem to work because the touch events seem to inherit from UIControl which isn't in the same universe as UIEvent. Is there any way to tell in my method which action caused the method to be called?