/CodeSnippets

代码模版

Primary LanguageMakefile

Snippets for Xcode

Stop typing boilerplate code!

This package contains the Xcode code snippets live templates I use.

install

1

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/LiZunYuan/CodeSnippets/master/shell/install.sh)"

2 Then relaunch Xcode.

remove

1

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/LiZunYuan/CodeSnippets/master/shell/uninstall.sh)"

2 Then relaunch Xcode.

Introduction

propa

@property (nonatomic, assign) <#type#> *<#variable#>;

9C79A834-2411-4227-B70F-63D2807D29B8.codesnippet

propc

@property (nonatomic, copy) <#type#> *<#variable#>;

34BC794F-28F4-48E9-A86D-44C3013DE167.codesnippet

propw

@property (nonatomic, weak) <#type#> *<#variable#>;

810AEB15-97CF-4207-8B2E-CC3FAFC60EFE.codesnippet

props

@property (nonatomic, strong) <#type#> *<#variable#>;

718740CD-AF47-4C93-8B58-C9D8F58B1330.codesnippet

ws

__weak typeof(self) weakSelf = self;

042C6FCB-ABA2-4E9C-BB5A-AA75873428C6.codesnippet

interface

@interface <#method#>()

@end

8D68DFE7-69E7-46E6-B4F0-F3C5EEC1BC12.codesnippet

sharedInstance

+ (instancetype)sharedInstance
{
    static id sharedInstance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        sharedInstance = [[self alloc] init];
    });    
    return sharedInstance;
}

45D5535E-44FA-491F-8E4B-3251A46D5372.codesnippet

pragma

#pragma mark - <#Label#>

4153CD73-5499-4668-B452-128583FC6848.codesnippet

notification-add

[[NSNotificationCenter defaultCenter] addObserver: self selector:@selector(<#method#>:) name:<#notificationName#> object:nil];

91A506E0-6D5F-47CF-826B-D308C68D33A8.codesnippet

notification-remove

[[NSNotificationCenter defaultCenter] removeObserver:self name:<#notificationName#> object:<#nil#>];

17E52D66-5DEC-4AB6-A255-4352CFD38BE5.codesnippet

notification-post

 [[NSNotificationCenter defaultCenter] postNotificationName:<#notificationName#> object:nil userInfo:<#nil#>];

45E738C9-F126-4C72-93C4-911F094C63F9.codesnippet