Skip to content

Instantly share code, notes, and snippets.

@augustj
Last active August 29, 2015 14:03
Show Gist options
  • Save augustj/c0a5496671e0eeede238 to your computer and use it in GitHub Desktop.
Save augustj/c0a5496671e0eeede238 to your computer and use it in GitHub Desktop.
CFStoryboard.m - UIStoryboard subclass that injects Objection dependcies
#import "Objection.h"
#import "CFStoryboard.h"
@implementation CFStoryboard
- (id)instantiateViewControllerWithIdentifier:(NSString *)identifier
{
NSLog(@"Injecting objects into UIViewController with identifier %@", identifier);
UIViewController *controller = [super instantiateViewControllerWithIdentifier:identifier];
[[JSObjection defaultInjector] injectDependencies:controller];
return controller;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment