zoukankan      html  css  js  c++  java
  • 常用的code snipper

    Xcode 10.2.1 版本,自动代码提示功能延迟很大,很多情况下代码提示甚至会无效,但是code snippet 唤起的响应很快,从提高效率的情况考虑,即使系统提供的代码提示制作成code snippet也是合适的。

    一下记录常用的code snippet 

    1,

    @interface <#statement#>()

    <#statement#>

    @end

    2,

    - (void)setBaseProperty{

        <#statement#>

    }

    3,

    -(void)addDataToSubviewsWithModel:(<#statement#> *)model{

        

    }

    4,

    if (self == [super init]) {

        <#statement#>

        }

        return self;

    5,

    - (instancetype)initWithFrame:(CGRect)frame{

        if (self == [super initWithFrame:frame]) {

            <#statement#>

        }

        return self;

    }

    6,

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

    7,

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

    8,

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

    9,

    @property (nonatomic ,weak) <#statement#> <#statement#>;

    10,

    @protocol  <#statement#>Protocol<NSObject>

    // loading

    - (void)presenterStartLoading;

    - (void)presenterEndLoading;

    // 加载数据

    -(void)presenterLoadDataSuccess:(<#statement#> *)model;

    -(void)presenterLoadDataError:(NSError *)error;

    @end

    @interface <#statement#> : NSObject

    - (instancetype)initWithDelegate:(id<<#statement#>>) delegate;

    - (void)presenterLoadData;

    @end

    11,

    @interface <#modelName#>Protocol <NSObject>

    - (void)modelLoadDataSuccess:(NSMutableArray *)dataArray;

    @end

    @interface <#modelName#> : NSObject

    - (instancetype)initWithDelegate(id<<#protocolName#>>) delegate;

    - (void)modelLoadData;

    @end

  • 相关阅读:
    面向对象程序设计简介(1/2)
    iOS官方Sample大全
    AFN不支持 "text/html" 的数据的问题:unacceptable content-type: text/html
    谈ObjC对象的两段构造模式
    关于self和super在oc中的疑惑与分析 (self= [super init])
    在Xcode中使用Git进行源码版本控制
    NSObject之二
    NSObject之一
    Objective-C Runtime 运行时之六:拾遗
    Objective-C Runtime 运行时之五:协议与分类
  • 原文地址:https://www.cnblogs.com/huaida/p/11155928.html
Copyright © 2011-2022 走看看