Skip to content

Instantly share code, notes, and snippets.

@HHuckebein
Created August 27, 2013 07:15
Show Gist options
  • Save HHuckebein/6350559 to your computer and use it in GitHub Desktop.
Save HHuckebein/6350559 to your computer and use it in GitHub Desktop.
UIViewController category to for TDD manually triggered segues.
static const char *storyboardSegueKey = "TestAssociatedStoryboardKey";
static const char *senderKey = "TestAssociatedSenderKey";
@implementation YourViewController (Testing)
- (void)documentsBrowserTest_prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
objc_setAssociatedObject(self, storyboardSegueKey, segue, OBJC_ASSOCIATION_RETAIN);
objc_setAssociatedObject(self, senderKey, sender, OBJC_ASSOCIATION_RETAIN);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment