Skip to content

Instantly share code, notes, and snippets.

@Adlai-Holler
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Adlai-Holler/9084173 to your computer and use it in GitHub Desktop.
Save Adlai-Holler/9084173 to your computer and use it in GitHub Desktop.
/** Public, and safe since UIKit is single-threaded */
+(instancetype)controllerWithParam:(id)param0 {
nextParam0 = param0;
id vc = [[UIStoryboard storyboard…] instantiateViewController…];
return vc;
}
static id nextParam0;
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if(!self) return nil;
self.param0 = nextParam0;
nextParam0 = nil;
return self;
}
// or even
-(id)initWithCoder:(NSCoder *)aDecoder param0:(id)p0 {
self = [super initWithCoder:aDecoder];
if(!self) return nil;
self.param0 = p0;
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder {
id p0 = nextParam0; nextParam0 = nil;
return [self initWithCoder:aDecoder param0:nextParam0];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment