项目开发中方便的小技巧

来源:互联网 发布:网络服务器是指 编辑:程序博客网 时间:2024/04/29 19:41

打印定义的宏

#ifdef DEBUG#define SKLog(...) NSLog(__VA_ARGS__)#else#define SKLog(...)#endif

定义字体颜色宏

//颜色/**高亮灰色*/#define LIGHTGRAY [UIColor lightGrayColor]/**白*/#define WHITE [UIColor whiteColor]/**黑*/#define BLACK [UIColor blackColor]/**红*/#define RED   [UIColor  redColor]/**清空色*/#define CLEAR [UIColor clearColor]/**rgb颜色*/#define SKColor(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]#define SKFocusBtnColor SKColor(25,136,204)/**随机色*/#define SKRandomColor SKColor(arc4random_uniform(256),arc4random_uniform(256),arc4random_uniform(256))

宏定义的屏幕的宽度和高度

#define UIScreenW [UIScreen mainScreen].bounds.size.width#define UIScreenH [UIScreen mainScreen].bounds.size.height#define WIDTH self.view.bounds.size.width#defint HEIGHT self.view.bounds.size.height

各种自字体

#define SKFont(a) [UIFont systemFontOfSize:(a)]#define SKNameFont [UIFont systemFontOfSize:14]#define SKTextFont [UIFont systemFontOfSize:13]#define SKTimeFont [UIFont systemFontOfSize:10]#define SKLocationFont [UIFont systemFontOfSize:12]系统版本#define iOS8 [[[UIDevice currentDevice] systemVersion] doubleValue]>8.0

Xcode 快捷键

command + n //新建一个工程 command + F 文档搜索 和 运行效果查找(reason)command + 特殊字符  //如NSString 文档alt + 鼠标 (ApI文档)command + alt +ESc //强制退出command +shift +h //UI运行时返回ctrl + 左右箭头command +shift +o  //搜索工程F4  //切换界面ctrl + command+ 空格 //切换表情ctrl+空格 //切换输入法command + , 设置 上面显示行数 line Numbers  Code folding ribbon 代码折叠丝带(都打勾)shitf + alt + command + 左 折叠shitf + alt + command + 右 折叠打开command+ shift +上 选中删除command+ shift +下选中删除command+Ctrol+上下键 可来回切换 .h 与 .m 文件Ctrl + i 选中代码可以调节整齐
0 0