//
// 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 #