Xcode的代码片段(Code Snippets)创建自定义的代码片段

1.copy:

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

2.strong:

@property (nonatomic, strong) <#Class#> *<#object#>;

3.weak:

@property (nonatomic, weak) <#Class#> *<#object#>;

4.assign:

@property (nonatomic, assign) <#Class#> <#property#>;

5.delegate:

@property (nonatomic, weak) id<<#protocol#>> <#delegate#>;

6.block:

@property (nonatomic, copy) <#Block#> <#block#>;

7.mark:

#pragma mark - <#mark#>

8.warning:

#warning <#message#>

9.ReUseCell:

static NSString *rid=<#rid#>;

<#Class#> *cell=[tableView dequeueReusableCellWithIdentifier:rid];

if(cell==nil){

cell=[[<#Class#> alloc] initWithStyle:UITableViewCellStyleDefault      reuseIdentifier:rid];

}

returncell;

10.initObj:

if(self=[superinit]){

<#init#>

}

returnself;

11.dataFill:

-(void)dataFill:(<#ModelClass#> *)<#model#>{

<#code#>

}

12.MainGCD:

dispatch_async(dispatch_get_main_queue(), ^{

<#code#>

});

13.GlobalGCD:

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

<#code#>

});

14.AfterGCD:

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(<#delayInSeconds#> * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

<#code to be executed after a specified delay#>

});

15.OnceGCD:

static dispatch_once_t onceToken;

dispatch_once(&onceToken, ^{

<#code to be executed once#>

});


欢迎关注我的微信公众号: Cydiapple欢迎访问: https://github.com/XLsn0w

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 代码片段 Xcode的代码片段(Code Snippets)创建自定义的代码片段,当你重用这些代码片段时,会给你带...
    XLsn0w阅读 426评论 0 0
  • *面试心声:其实这些题本人都没怎么背,但是在上海 两周半 面了大约10家 收到差不多3个offer,总结起来就是把...
    Dove_iOS阅读 27,636评论 30 472
  • 手指为什么爱出倒刺 张思莱医师 新浪博客 问:我的孩子手指尖很容易出倒刺,听网上有人说与遗传有关系,是这样的吗?...
    _FLY_阅读 378评论 0 1

友情链接更多精彩内容