Skip to content

Instantly share code, notes, and snippets.

@klaaspieter
Created January 15, 2014 17:19
Show Gist options
  • Save klaaspieter/8440369 to your computer and use it in GitHub Desktop.
Save klaaspieter/8440369 to your computer and use it in GitHub Desktop.
Triggering actions on controls using sendActionsForControlEvents: will not pass a `UIEvent` to action:forEvent:
@implementation ViewController
- (void)triggerAction;
{
[self.button sendActionsForControlEvents:UIControlEventTouchUpInside];
}
- (void)action:(id)sender forEvent:(UIEvent *)event;
{
// event is UIEvent when triggered by a touch on the button.
// event is ViewControler when triggered using sendActionsForControlEvents:
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment