前言
文中将要介绍以下四点内容
下面话不多说了,来一起看看详细的介绍吧
一 . 意义在于节约时间成本
like 我在编译器键入 strong, 回车 自动生成 @property (nonatomic, strong) <#Class#> *<#object#>;
二 . 如何自定义代码块
如下图所示 选中一行代码右键 crate code snippet
右上角方框快速进入
图1
下图填入描述, 以及快捷方式
图2
三 . iOS Xcode自定义代码块迁移
四 . 代码块编写
下面我举个栗子 . 0.O
- (UITableView *)<#tableview#> { if(!<#tableview#>) { <#tableview#> = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain]; <#tableview#>.delegate =self; <#tableview#>.dataSource =self; [<#tableview#> registerClass:[<#cell#> class] forCellReuseIdentifier:@"cellIdentifier"]; } return <#tableview#>; } #pragma mark - tableView delegate - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return <#expression#> } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return <#expression#> } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { <#UITableViewCell#> *cell = [tableView dequeueReusableCellWithIdentifier:@"cellIdentifier"]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { }
注: <#class#> 即为可以替换的词语.
我再举个栗子
@property (nonatomic, assign) <#Class#> <#object#>;
总结
留作备忘
给需要的人
好了,以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对呐喊教程的支持。
声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:notice#nhooo.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。