一、Xcode
- 帮助文档
- 清爽打印
- 快捷代码块
二、Model转换工具
一、Xcode
1. 帮助文档
2. 清爽打印
#ifdef DEBUG
#define HTLog(format, ...) printf("%s\n", [[NSString stringWithFormat:format, ## >__VA_ARGS__] UTF8String]);
#else
#define HTLog(format, ...);
#endif
3. 快捷代码块
设置快捷关键字
,自定义快捷代码块
内容
示例:
Xcode中输入
@property (nonatomic, strong) <#Class#> *<#object#>;
选中
代码块
,右键Create Code Snippet
设置
标题
,描述
,快捷关键字
xps。 (xcode property strong)完成后进入代码中输入
xps
,就可找到{}
代码块了
常用代码块
- strong:
@property (nonatomic, strong) <#Class#> *<#object#>;
- weak:
@property (nonatomic, weak) <#Class#> *<#object#>;
- copy:
@property (nonatomic, copy) NSString *<#string#>;
- assign:
@property (nonatomic, assign) <#Class#> <#property#>;
- delegate:
@property (nonatomic, weak) id<<#protocol#>> <#delegate#>;
- block:
@property (nonatomic, copy) <#returnType#>(^<#blockName#>)(<#arguments#>);
- mark:
#pragma mark - <#mark#>
- MainGCD:
dispatch_async(dispatch_get_main_queue(), ^{ <#code#> });
- AfterGCD:
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(<#delayInSeconds#> * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ <#code#> });
- 单例(OnceGCD) :
static <#class#> *singleClass = nil; + (instancetype)shareInstance{ static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ <#code to be executed once#> }); return <#expression#> }
二、Model转换工具
快速将接口文档
转换为各语言的Model
👉 quicktype