iOS 开发----Xcode 编码快捷提示

先提供几个以下的快捷方式,我在开发中常常用到的.atom

// 定义强指针类型
@property (nonatomic ,strong) <#type#> *<#name#>;
// 定义弱指针类型
@property (nonatomic ,weak) <#type#> *<#name#>;
// 定义基本数据类型
@property (nonatomic ,assign) <#type#> <#name#>;
// 定义 NSString 文本类型
@property (nonatomic, copy) <#type#> *<#name#>;
// 定义计数器类型(主要用在 MRC 工程中)
@property (nonatomic ,retain) <#type#> *<#name#>;
/**
 *  每行显示什么内容
 *
 *  @param tableView tableView
 *  @param indexPath
 *
 *  @return cell
 */
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *ID = <#ID#>;
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    return cell;
}
/**
 *  懒加载
 */
- <#methodName#>{
    if (_<#methodName#> == nil) {
        self.<#methodName#> = <#initCode#>;
    }
    return _<#methodName#>;
}


上面的这几种快捷提示方式我都是常常用到的,只要把上面这些拷贝到你的项目中的.m/.h 文件中就能直接用,具体方法以下spa

打开这个解决,暴力办法,直接拖过去,会出现以下界面:指针

这样就设置好了,你只要输入你Comletion Shotcut 里面的 strong 就能完整的打出来这么一串.是否是很方便?code


著做权声明:本文为做者原创,欢迎转载分享。请尊重做者劳动,转载时保留该声明和做者博客连接,谢谢!ci

相关文章
相关标签/搜索