1.关于NSLog输出

/**
* 当Xcode为Release时不输出,为Debug时输出
*
* @param ...
*
* @return
*/
#ifndef __OPTIMIZE__
#define NSLog(...) NSLog(__VA_ARGS__) /**
* 打印的时候能够看到类名、方法以及行数
*
*/
//#define NSLog(fmt,...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ## __VA_ARGS__); #else
#define NSLog(...) {}
#endif

2.颜色

#define RGB_Color(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define RGB_ColorAlpha(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]
#define RGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16)) / 255.0 green:((float)((rgbValue & 0xFF00) >> 8)) / 255.0 blue:((float)(rgbValue & 0xFF)) / 255.0 alpha:1.0]
#define RGBALPHA(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16)) / 255.0 green:((float)((rgbValue & 0xFF00) >> 8)) / 255.0 blue:((float)(rgbValue & 0xFF)) / 255.0 alpha:(a)]

3.屏幕大小

#define APP_SIZE [UIScreen mainScreen].bounds.size
#define APP_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define APP_HEIGHT ([UIScreen mainScreen].bounds.size.height)

4.系统版本号

#define PPSystemVersionGreaterOrEqualThan(version) ([[[UIDevice currentDevice] systemVersion] floatValue] >= version)
#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]
#define SYSTEM_VERSION_EQUAL_TO(v) \
([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) \
([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) \
([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) \
([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) \
([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)

(不断更新中)


最新文章

  1. 使用 python 获取 httpd 程序所占用物理内存
  2. POJ3398Perfect Service[树形DP 树的最大独立集变形]
  3. 在android用Get方式发送http请求
  4. 安装和使用memcached
  5. Redis实践操作之—— keyspace notification(键空间通知)
  6. android studio使用发布者证书调试
  7. Android自己主动化測试解决方式
  8. codevs4373 窗口==poj2823 Sliding Window
  9. T4模板使用
  10. JSON的数据类型
  11. 夏令营提高班上午上机测试 Day 3 解题报告
  12. solr研磨之性能调优
  13. 【转】三个案例带你看懂LayoutInflater中inflate方法两个参数和三个参数的区别
  14. 用 zotero 管理文献和个人知识库
  15. Docker笔记——jenkins镜像制作
  16. RabbitMQ 在 web 页面 创建 exchange, queue, routing key
  17. 4.1 C++多态的概念及前提条件
  18. SQL脚本添加删除修改字段
  19. vim 取消高亮
  20. echarts 地图 免费离线js,json包分享

热门文章

  1. (Go)02.go 安装delve调试工具测试
  2. 为什么用Mysql?
  3. winfrom窗体属性
  4. 洛谷P4413 [COCI2006-2007#2] R2(可持久化平衡树维护NTT)
  5. 超级简单的利用javascript实现文件拖拽事件
  6. hdu 3729 最大匹配
  7. SVN客户端安装 Linux
  8. js代码 注释 test
  9. jdbc转账操作
  10. 数据库_数据分片与mycat服务