/XCodeSnippets

CodeSnippets for Xcode + a python script to generate a readme so you can see what's in em

Primary LanguagePython

Checkout to: ~/Library/Developer/Xcode/UserData/CodeSnippets/

clang warning push/pop

#pragma clang diagnostic push
#pragma clang diagnostic ignored "<#-W warning#>"
<#code#>
#pragma clang diagnostic pop

dispatch_async global queue

dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
    <#code#>
});

dispatch_async main queue

dispatch_async(dispatch_get_main_queue(), ^{
    <#code#>
});

dispatch_once

static id <#object#>;
static dispatch_once_t once;
dispatch_once(&once, ^{
    <#object#> = <#value#>;
});

init

- (id)init{
    if(!(self = [super init])){
        return nil;
    }

    <#code#>

    return self;
}

Log Class:MethodName

NSLog(@"%@:%@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));

Log Method Name

NSLog(@"%@", NSStringFromSelector(_cmd));

NSArray Class Property

@property (nonatomic, strong) NSArray *<#propertyName#>;

NSDictionary Class Property

@property (nonatomic, strong) NSDictionary *<#propertyName#>;

NSNumber Class Property

@property (nonatomic, copy) NSNumber *<#propertyName#>;

NSString Class Property

@property (nonatomic, copy) NSString *<#propertyName#>;

Pragma section

#pragma mark - <#section#>

Property

@property (nonatomic, <#attribute#>) <#ClassName#> *<#propertyName#>;

Requires ARC

#if !__has_feature(objc_arc)
#error <#library#> must be built with ARC.
// You can turn on ARC for only <#library#> files by adding -fobjc-arc to the build phase for each of its files.
#endif

Generated by readme.py: python readme.py