Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Alcatraz internals

Alcatraz internals

Talk given on NSLondon, April 2014

Marin Usalj

April 29, 2014
Tweet

More Decks by Marin Usalj

Other Decks in Programming

Transcript

  1. + (void)pluginDidLoad:(NSBundle *)plugin { ! if ([currentApplicationName isEqual:@"Xcode"]) { static

    dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedPlugin = [[self alloc] initWithBundle:plugin]; }); } ! }
  2. + (void)pluginDidLoad:(NSBundle *)plugin { ! if ([currentApplicationName isEqual:@"Xcode"]) { static

    dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedPlugin = [[self alloc] initWithBundle:plugin]; }); } ! }
  3. @implementation ATZColorScheme ! - (ATZInstaller *)installer { return [ATZColorSchemeInstaller sharedInstaller];

    } ! - (NSString *)type { return COLOR_SCHEME; } ! - (BOOL)requiresRestart { return YES; } ! - (NSString *)extension { return DVTCOLORSCHEME; } ! - (NSString *)iconName { return COLOR_SCHEME_ICON_NAME; } ! @end
  4. @implementation ATZPlugin @synthesize requiresRestart; ! - (ATZInstaller *)installer { return

    [ATZPluginInstaller sharedInstaller]; } ! - (NSString *)type { return PLUGIN; } ! - (NSString *)extension { return XCPLUGIN; } ! - (NSString *)iconName { return PLUGIN_ICON_NAME; } ! @end
  5. @implementation ATZTemplate ! - (ATZInstaller *)installer { @throw [NSException exceptionWithName:@"Abstract

    template" reason:@"Please use one of ATZTemplate subclasses" userInfo:nil]; } ! - (NSString *)type { return nil; } ! - (BOOL)requiresRestart { return NO; } ! - (NSString *)extension { return XCTEMPLATE; } ! - (NSString *)iconName { return TEMPLATE_ICON_NAME; } ! @end
  6. NDA

  7. NDA