Appcode user snippets live templates - PaulTaykalo/AppCode-Settings GitHub Wiki

async

Async in backgound queue

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
    $END$
});

asynca

Dispatch async after timeout

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, $SECONDS$ * NSEC_PER_SEC), $QUEUE$, ^{
  $END$
});

asyncm

Dispatch async in main queue

dispatch_async(dispatch_get_main_queue(), ^{
   $END$
});

button

Simple UIbutton

UIButton * $BUTTONNAME$ = [UIButton new];

dealloc

dealloc

#pragma mark - Dealloc

- (void)dealloc {
   $END$
}

idef

Ivar definition

$CLASS$ * $_variable$;

once

Dispatch once

static dispatch_once_t $ONCE$;
dispatch_once(&$ONCE$, ^{
   $CURSOR$
});

sh

Shared instance

$CLASS$ * $CLASS2$ = [$CLASS$ $sharedName$];

test

testExample

-(void)test$TESTNAME$ {
   $CURSOR$
}

ws

weak self

__weak $CLASSNAME$ * weakSelf = self;