//

//  AddTopicViewController.m

//  vMeet2

//

//  Created by 张源海 on 16/6/30.

//  Copyright © 2016年 hdlt. All rights reserved.

//


#ifndef PrefixHeader_pch
#define PrefixHeader_pch //----------------------INSTALLATION 安装方法---------------------------- //Added the prefix header file to PROJECT:
//1.Creat a new PCH files and named it with "PrefixHeader.pch"(default name or anything you want) .
//2.Click next and go to Build Settings search Prefix Header.
//3.Double click the blank address and put this address: $(SRCROOT)/$(PROJECT_NAME)/PrefixHeader.pch
//THEN YOU CAN USE THIS IN EVERY FILES IN THIS PROJECT. Good luck. //如何安装:
//1.创建新pch文件,默认名字即可: "PrefixHeader.pch".
//2.点击下一步再去Build Settings 搜索Prefix Header.
//3.找到Prefix Header并且双击,输入$(SRCROOT)/$(PROJECT_NAME)/PrefixHeader.pch
//现在你可以在项目内任何文件调用宏定义了,祝一切顺利. // Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. //#endif /* PrefixHeader_pch */ //----------------------ABOUT SCREEN & SIZE 屏幕&尺寸 ----------------------------
/**
iPad Air {{0, 0}, {768, 1024}}
iphone4s {{0, 0}, {320, 480}} 960*640
iphone5 5s {{0, 0}, {320, 568}} 1136*640
iphone6 6s {{0, 0}, {375, 667}} 1334*750
iphone6Plus 6sPlus {{0, 0}, {414, 736}} 1920*1080
Apple Watch 1.65inches(英寸) 320*640
*/ #define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
#define kTabBarH 49.0f
#define kStatusBarH 20.0f
#define kNavigationBarH 44.0f
#define SCREEN_POINT (float)SCREEN_WIDTH/320.f
#define SCREEN_H_POINT (float)SCREEN_HEIGHT/480.f //判断是否 Retina屏、设备是否iPhone 5、是否是iPad
#define isRetina ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO) /** 判断是否为iPhone */
#define isiPhone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) /** 判断是否是iPad */
#define isiPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) /** 判断是否为iPod */
#define isiPod ([[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"]) /** 设备是否为iPhone 4/4S 分辨率320x480,像素640x960,@2x */
#define iPhone4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO) /** 设备是否为iPhone 5C/5/5S 分辨率320x568,像素640x1136,@2x */
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO) /** 设备是否为iPhone 6 分辨率375x667,像素750x1334,@2x */
#define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO) /** 设备是否为iPhone 6 Plus 分辨率414x736,像素1242x2208,@3x */
#define iPhone6P ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO) //----------------------ABOUT SYSTYM & VERSION 系统与版本 ----------------------------
//Get the OS version. 判断操作系统版本
#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]
#define CurrentSystemVersion ([[UIDevice currentDevice] systemVersion])
#define CurrentLanguage ([[NSLocale preferredLanguages] objectAtIndex:0]) //judge the simulator or hardware device 判断是真机还是模拟器
#if TARGET_OS_IPHONE
//iPhone Device
#endif #if TARGET_IPHONE_SIMULATOR
//iPhone Simulator
#endif /** 获取系统版本 */
#define iOS_VERSION ([[[UIDevice currentDevice] systemVersion] floatValue])
#define CurrentSystemVersion ([[UIDevice currentDevice] systemVersion]) /** 是否为iOS6 */
#define iOS6 (([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0) ? YES : NO) /** 是否为iOS7 */
#define iOS7 (([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) ? YES : NO) /** 是否为iOS8 */
#define iOS8 (([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) ? YES : NO) /** 是否为iOS9 */
#define iOS9 (([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0) ? YES : NO) /** 获取当前语言 */
#define kCurrentLanguage ([[NSLocale preferredLanguages] objectAtIndex:0]) //----------------------ABOUT PRINTING LOG 打印日志 ----------------------------
//Using dlog to print while in debug model. 调试状态下打印日志
#ifdef DEBUG
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
# define DLog(...)
#endif //Printing while in the debug model and pop an alert. 模式下打印日志,当前行 并弹出一个警告
#ifdef DEBUG
# define ULog(fmt, ...) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"%s\n [Line %d] ", __PRETTY_FUNCTION__, __LINE__] message:[NSString stringWithFormat:fmt, ##__VA_ARGS__] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; }
#else
# define ULog(...)
#endif /** print 打印rect,size,point */
#ifdef DEBUG
#define kLogPoint(point) NSLog(@"%s = { x:%.4f, y:%.4f }", #point, point.x, point.y)
#define kLogSize(size) NSLog(@"%s = { w:%.4f, h:%.4f }", #size, size.width, size.height)
#define kLogRect(rect) NSLog(@"%s = { x:%.4f, y:%.4f, w:%.4f, h:%.4f }", #rect, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)
#endif //----------------------ABOUT COLOR 颜色相关 ---------------------------- #define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
// rgb颜色转换(16进制->10进制)
#define UIColorFromRGB(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] //带有RGBA的颜色设置
#define COLOR(R, G, B, A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A] #define kClearColor [UIColor clearColor] #define COLOR_BLUE_ UIColorFromRGB(0x41CEF2)
#define COLOR_GRAY_ UIColorFromRGB(0xababab) //171
#define COLOR_333 UIColorFromRGB(0x333333) //51
#define COLOR_666 UIColorFromRGB(0x666666) //102
#define COLOR_888 UIColorFromRGB(0x888888) //136
#define COLOR_999 UIColorFromRGB(0x999999) //153
#define COLOR_PLACEHOLD_ UIColorFromRGB(0xc5c5c5) //197
#define COLOR_RED_ UIColorFromRGB(0xff5400) //红色
#define COLOR_GREEN_ UIColorFromRGB(0x31d8ab)//绿色
#define COLOR_YELLOW_ UIColorFromRGB(0xffa200)//黄色
#define COLOR_SEPARATE_LINE UIColorFromRGB(0xC8C8C8)//200
#define COLOR_LIGHTGRAY COLOR(200, 200, 200, 0.4)//淡灰色 #define MAX_WIDTH_10 (SCREEN_WIDTH-20)
#define MAX_WIDTH_15 (SCREEN_WIDTH-30) //----------------------ABOUT IMAGE 图片 ---------------------------- //LOAD LOCAL IMAGE FILE 读取本地图片
#define LOADIMAGE(file,ext) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:file ofType:ext]] //DEFINE IMAGE 定义UIImage对象// imgView.image = IMAGE(@"Default.png"); #define IMAGE(A) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:A ofType:nil]] //DEFINE IMAGE 定义UIImage对象
#define ImageNamed(_pointer) [UIImage imageNamed:[UIUtil imageName:_pointer]] //BETTER USER THE FIRST TWO WAY, IT PERFORM WELL. 优先使用前两种宏定义,性能高于后面. //----------------------SOMETHING ELSE 其他 ---------------------------- #define intToStr(S) [NSString stringWithFormat:@"%d",S] //
//#define NotificationWarning(msg) [JDStatusBarNotification showWithStatus:msg dismissAfter:2.0 styleName:JDStatusBarStyleWarning]
//
//#define NotificationError(msg) [JDStatusBarNotification showWithStatus:msg dismissAfter:2.0 styleName:JDStatusBarStyleError]
//
//#define NotificationSuccess(msg) [JDStatusBarNotification showWithStatus:msg dismissAfter:2.0 styleName:JDStatusBarStyleSuccess] /**
* the saving objects 存储对象
*
* @param __VALUE__ V
* @param __KEY__ K
*
* @return
*/
#define UserDefaultSetObjectForKey(__VALUE__,__KEY__) \
{\
[[NSUserDefaults standardUserDefaults] setObject:__VALUE__ forKey:__KEY__];\
[[NSUserDefaults standardUserDefaults] synchronize];\
} /**
* get the saved objects 获得存储的对象
*/
#define UserDefaultObjectForKey(__KEY__) [[NSUserDefaults standardUserDefaults] objectForKey:__KEY__] /**
* delete objects 删除对象
*/
#define UserDefaultRemoveObjectForKey(__KEY__) \
{\
[[NSUserDefaults standardUserDefaults] removeObjectForKey:__KEY__];\
[[NSUserDefaults standardUserDefaults] synchronize];\
} #define PLIST_TICKET_INFO_EDIT [NSHomeDirectory() stringByAppendingString:@"/Documents/data.plist"] //edit the plist #define TableViewCellDequeueInit(__INDETIFIER__) [tableView dequeueReusableCellWithIdentifier:(__INDETIFIER__)]; #define TableViewCellDequeue(__CELL__,__CELLCLASS__,__INDETIFIER__) \
{\
if (__CELL__ == nil) {\
__CELL__ = [[__CELLCLASS__ alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:__INDETIFIER__];\
}\
} #define KEYWINDOW [UIApplication sharedApplication].keyWindow //Show Alert, brackets is the parameters. 宏定义一个弹窗方法,括号里面是方法的参数
#define ShowAlert UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Warning." message:nil delegate:self cancelButtonTitle:@"cancel" otherButtonTitles: @"OK"];[alert show]; #endif //define an API 定义一个API
#define APIURL @"http://www.google.com"
//login the API 登陆API
#define APILogin [APIURL stringByAppendingString:@"Login"] //GCD
#define GCDWithGlobal(block) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block)
#define GCDWithMain(block) dispatch_async(dispatch_get_main_queue(),block) //NSUserDefaults 实例化
#define USER_DEFAULT [NSUserDefaults standardUserDefaults] //单例化 一个类
#define SYNTHESIZE_SINGLETON_FOR_CLASS(classname) \
\
static classname *shared##classname = nil; \
\
+ (classname *)shared##classname \
{ \
@synchronized(self) \
{ \
if (shared##classname == nil) \
{ \
shared##classname = [[self alloc] init]; \
} \
} \
\
return shared##classname; \
} \
\
+ (id)allocWithZone:(NSZone *)zone \
{ \
@synchronized(self) \
{ \
if (shared##classname == nil) \
{ \
shared##classname = [super allocWithZone:zone]; \
return shared##classname; \
} \
} \
\
return nil; \
} \
\
- (id)copyWithZone:(NSZone *)zone \
{ \
return self; \
} /** 快速查询一段代码的执行时间 */
/** 用法
TICK
do your work here
TOCK
*/ #define TICK NSDate *startTime = [NSDate date];
#define TOCK NSLog(@"Time:%f", -[startTime timeIntervalSinceNow]);

 

JDStatusBarNotification和一些宏定义的更多相关文章

  1. c++宏定义命令

    在程序开始以#开头的命令,他们是预编译命令.有三类预编译命令:宏定义命令.文件包含命令.条件编译命令:今天聊聊宏定义: 宏定义命令将一个标识符定义为一个字符串,源程序中的该标识符均以指定的字符串来代替 ...

  2. dll导入导出宏定义,出现“不允许 dllimport 函数 的定义”的问题分析

    建立dll项目后,在头文件中,定义API宏 #ifndef API_S_H #define API_S_H ...... #ifndef DLL_S_20160424 #define API _dec ...

  3. iOS之常用宏定义

    下面我为大家提供一些常用的宏定义! 将这些宏定义 加入到.pch使用 再也不用 用一次写一次这么长的程序了 //-------------------获取设备大小------------------- ...

  4. linux中offsetof与container_of宏定义

    linux内核中offsetof与container_of的宏定义 #define offsetof(TYPE, MEMBER)    ((size_t) &((TYPE *)0)->M ...

  5. Linux Kernel代码艺术——系统调用宏定义

    我们习惯在SI(Source Insight)中阅读Linux内核,SI会建立符号表数据库,能非常方便地跳转到变量.宏.函数等的定义处.但在处理系统调用的函数时,却会遇到一些麻烦:我们知道系统调用函数 ...

  6. 面试问题5:const 与 define 宏定义之间的区别

    问题描述:const 与 define 宏定义之间的区别 (1) 编译器处理方式不同     define宏是在预处理阶段展开:     const常量是编译运行阶段使用: (2) 类型和安全检查不同 ...

  7. 关于Xcode8.1 / iOS10+ 真机测试系统打印或者宏定义打印不显示问题

    前言: 最近做项目时遇到了很多莫名其妙的问题,其中就有这个打印(NSLog).也不多废话了,我们先来回顾一下Xcode8发布以来,我们遇到的一些关于打印的问题,当然也有解决方法: 1.Xcode8打印 ...

  8. #define宏定义形式的"函数"导致的bug

    定义了一个宏定义形式的"函数": #define  SUM8(YY)\ {\ int Y = YY>>2;\ ...\ } 然后使用的时候,传入了一个同名的变量Y: i ...

  9. 黑马程序员——C语言基础 枚举 宏定义 自定义 static exterm

    Java培训.Android培训.iOS培训..Net培训.期待与您交流! (以下内容是对黑马苹果入学视频的个人知识点总结) (一)枚举 1)枚举类型的定义 枚举是C语言中的一种基本数据类型,并不是构 ...

随机推荐

  1. python爬虫beta版之抓取知乎单页面回答(low 逼版)

    闲着无聊,逛知乎.发现想找点有意思的回答也不容易,就想说要不写个爬虫帮我把点赞数最多的给我搞下来方便阅读,也许还能做做数据分析(意淫中--) 鉴于之前用python写爬虫,帮运营人员抓取过京东的商品品 ...

  2. kafka综合介绍

    设计目标 高吞吐率.即使在非常廉价的商用机器上也能做到单机支持每秒100K条以上消息的传输. 支持Kafka Server间的消息分区,及分布式消费,同时保证每个Partition内的消息顺序传输 同 ...

  3. javascript入门:prototype和面向对象的实现

    由于工作需要,需要大量使用javascript,于是对其进行了一下学习. 学习任何一个语言,最重要的是掌握其和其他语言不同的关键特性.对javascript来说,我总结就是prototype.就像me ...

  4. selenium webdriver自动化测试

    selenium家族介绍           Selenium IDE:Selenium IDE是嵌入到Firefox浏览器中的一个插件,实现简单的浏览器操作的录制与回放功能.   Selenium ...

  5. PBOC2.0中消费交易流程

    消费交易允许持卡人使用电子存折或电子钱包的余额进行购物或获取服务.此交易可以在销售点终端(POS)上脱机进行.使用电子存折进行的消费交易必须提交个人识别码(PIN),使用电子钱包则不需要. 1.1 终 ...

  6. 总结Lvs、nginx、Haproxy

    !!!! 参考的比较多,自己想法少 大神总结的比较好 ====>http://www.ha97.com/5646.html 特性  LVs Nginx Haproxy 工作层 四层(传输层) 七 ...

  7. p6 备忘录

    1.报表执行过程:PROC_PM_RP_Implent,PROC_PM_RP_Implent 2.新增用户无法获取p6 计划,主要是因为没有项目信息.分类码授权(计划分类).

  8. LeetCode Coin Change

    原题链接在这里:https://leetcode.com/problems/coin-change/ 题目: You are given coins of different denomination ...

  9. MVC中的成员资格,授权,安全性

    使用 Authorize 特性登录 Authorize 是 ASP.NET MVC 自带的默认授权过滤器, 可用来限制用户对操作方法的访问. 保护控制器操作 Authorize 特性在表单身份验证和 ...

  10. 【翻译】如何给tomcat配置memcached-session-manager

    原文在这 ,其实不是忠实翻译,就是按照自己理解记录一下 第一步,下载所需的jar包 下载 memcached-session-manager-x.y.z.jar, memcached-session- ...