将文件放入目录~/Library/Developer/Xcode/UserData/CodeSnippets/
中
重启Xcode
简写 | 对应代码 |
---|---|
mark1 | #pragma mark - 1️⃣➢➢➢ <#mark#> |
mark! | //!!!!: <#注释#> |
blockproperty | @property (nonatomic,copy) <#returnType#> (^<#blockName#>)(<#parameterTypes#>); |
pa | @property (nonatomic,assign) <#type#> <#name#> |
pc | @property (nonatomic, copy) <#type#> *<#name#> |
psr | @property (nonatomic, strong, readonly) <#type#> *<#name#> |
ps | @property (nonatomic, strong) <#type#> *<#name#> |
pw | @property (nonatomic, weak) <#type#> <#name#> |
sharedInstance | + (instancetype)sharedInstance { static dispatch_once_t onceToken; static <#class name#> *instance = nil; dispatch_once(&onceToken,^{ instance = [[super allocWithZone:NULL] init]; }); return instance; } + (id)allocWithZone:(struct _NSZone *)zone{ return [self sharedInstance]; } |
protocol | @protocol <#DataSource#> < NSObject > @required @end |