Skip to content

Instantly share code, notes, and snippets.

@psobko
Created December 19, 2013 17:35
Show Gist options
  • Select an option

  • Save psobko/8043152 to your computer and use it in GitHub Desktop.

Select an option

Save psobko/8043152 to your computer and use it in GitHub Desktop.
Check if a UIButton is wired to an action
-(BOOL)validateButton:(UIButton*)button WiredToAction:(NSString*)action
{
NSArray *actions = [button actionsForTarget:testSubject forControlEvent:UIControlEventTouchUpInside];
XCTAssertNotNil(actions);
return ([actions indexOfObject:action] != NSNotFound);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment