// // MacroFile.h // jitao // // Created by 罗云飞 on 2017/3/9. // Copyright © 2017年 罗云飞. All rights reserved. // #ifndef MacroFile_h #define MacroFile_h #endif /* MacroFile_h */ /* ----------------------------------------------------------------------------------- ------------------------环境切换 版本号 客服电话 客户端来源--------------------------- ----------------------------------------------------------------------------------- */ #define NewAppKey @"" //服务平台每个项目的appKey 签名密钥 开发环境 #define NewDeviceClass @"iphone" //客户端来源 #define NewSecurityCode @"" //安全码 #define NewVersionNumber @"1.0" //当前项目版本号 #define NewAppletSwitch @"0"//小程序入口开关,0是关,1是开 #define NewLogSwitch @"1"//日志打印开关,0是关,1是开 #define NewServiceTelephone @"" //服务电话 #define NewMailbox @"" //邮箱 #define NewShareURL @"" //微信分享的默认链接使用 /** * 弹窗消息Title提示 */ #define NewMessageDisplayTime 10 //消息展示时间 #define NewPushTitle @"技淘" #define NewPushImage [UIImage imageNamed:@"推送图标"] #define NewReminderTitle @"温馨提示" #define NewNoNetworkTitle @"网络不给力,请检查网络设置。" #define NewNoNetworkImage [UIImage imageNamed:@"推送图标"] //公共通知Key #define NewJitaoServerPublicNotification @"消息推送" #define NewtuisongManageNotification @"通知跳转" #define SERVER_HTML5_URL @"" //H5开发环境 //#define SERVER_HTML5_URL @"" //H5发布环境 //#define OSSUpload_URL @"" //上传图片/视屏/文件URL //苹果内购 沙盒测试环境验证 #define Pay_SANDBOX @"https://sandbox.itunes.apple.com/verifyReceipt" //苹果内购 正式环境验证 #define Pay_AppStore @"https://buy.itunes.apple.com/verifyReceipt" /* ----------------------------------------------------------------------------------- --------------------------------------用户信息-------------------------------------- ----------------------------------------------------------------------------------- */ #define NewAccountNumber @"newAccountNumber" //账号 #define NewAccountPassword @"newAccountPassword" //账号密码 #define NewOpenId @"newOpenId" //账号唯一标识符 一个共同的账号在每个项目的userId不一样,但OpenId是一样的 #define NewUsername @"newUsername" //用户名称 #define NewMobileNumber @"newMobileNumber" //用户手机号码 #define NewToken @"newtoken" //令牌 登录有效期 #define NewType @"newtype" //类别 个人or企业 #define NewID @"newID" //用户ID #define NewHXUsername @"newHXUsername" //环信账号 #define NewHXPassword @"newHXPassword" //环信密码 #define NewHXheadUrl @"NewHXheadUrl" //用户头像 /* ----------------------------------------------------------------------------------- -------------------------------------工具类key值------------------------------------ ----------------------------------------------------------------------------------- */ //项目版本key #define NewAPPVersion @"NewAPPVersion" #define NewLocationCue @"NewLocationCue" /* ----------------------------------------------------------------------------------- ---------------------------------第三方SDK对应的key值-------------------------------- ----------------------------------------------------------------------------------- */ //微信 #define WXKey @"wx60c918b577a3885d" #define WXAppSecret @"64a3a2fa27eec87d996fa20c44a7f041" //极光推送 #define JPushKey @"dbcea43366e038073452a04e"//新的极光 //#define JPushKey @"36944c5628d34ff997f56dcd" //环信APPKEY #define HXAPPKey @"1117170814115609#jitao" #define JPushChannel @""//发布渠道. 可选. #define JPushIsProduction 1 //是否生产环境. 如果为开发状态,设置为 NO; 如果为生产状态,应改为 YES. /* ----------------------------------------------------------------------------------- --------------------------------------Java接口标识-------------------------------------- ----------------------------------------------------------------------------------- */ //#define SERVER_URL @"http://192.168.1.213:8080/" //辉哥本地环境 //#define SERVER_URL @"http://192.168.0.99:8080/" //贺纯安本地环境 //#define SERVER_URL @"http://192.168.1.115:8080/" //彭本地环境 //#define SERVER_URL @"http://uat.jishutao.com/" //测试环境 //#define HTML5_URL @"http://muat.jishutao.com/" //H5页面测试地址 #define SERVER_URL @"http://www.jishutao.com/" //生产地址 #define HTML5_URL @"http://m.jishutao.com/" //H5页面生产地址 #define HXKF @"888878" //测试环信客服 //#define HXKF @"88888888" //生产环信客服 //文件上传 图片/视频 地址: #define OSSUpload_URL @"http://ss.jishutao.com/upload"//生产 //#define OSSUpload_URL @"http://statics.jishutao.com/upload"//测试环境 非上传 #define OSSUpload_URLNew @"http://statics.jishutao.com/portal/1.0.0"//废弃 //#define OSSUpload_URL @"http://sb.jishutao.com/upload"//开发环境 #define JT_signin @"mlogin" //登录 #define JT_getAppMCode @"open/getRegisterMCode" //注册 下发短信 #define JT_register @"mregister" //注册 #define JT_getResetMCode @"open/getResetMCode"//修改密码 下发短信 #define JT_resetPwd @"app/user/updatePassword" //修改密码 #define JT_appResetPwd @"open/appResetPwd" //忘记密码 #define JT_uploadImg @"app/user/uploadImg" //上传头像 #define JT_updateUser @"app/user/updateUser" //更新用户信息(修改用户名) #define JT_userInfo @"app/user/userInfo" //获取用户基本信息 #define JT_logout @"app/user/logout" //退出用户登录 #define JT_industryList @"open/app/discovery/industryList" //(发现)行业分类列表 #define JT_achievementList @"open/app/discovery/achievementList" //(发现)科技成果列表 #define JT_demandList @"open/app/discovery/demandList" //(发现)科技需求列表 #define JT_expertsList @"open/app/discovery/expertsList" //(发现)科技专家列表 #define JT_achievementDetail @"open/app/user/achievementDetail" //(发现)科技成果详情 #define JT_demandDetail @"open/app/user/demandDetail" //(发现)科技需求详情 #define JT_expertsDetail @"open/app/user/expertsDetail" //(发现)科技专家详情 #define JT_interestAdd @"app/user/interestAdd" //关注 #define JT_interestList @"app/user/interestList" //关注列表 #define JT_MydemandList @"app/user/demandList" //(我的)我的需求列表 #define JT_MyachievementList @"app/user/achievementList" //(我的)我的成果列表 #define JT_listMessage @"app/user/listMessage" //(我的)系统消息 #define JT_readMessage @"app/user/readMessage" //(我的)系统消息详情 #define JT_getVarieties @"open/app/service/getVarieties" //(服务)获取初级品类 #define JT_recommendProjectList @"open/app/service/recommendProjectList" //(服务)推荐列表 #define JT_consultantList @"open/app/service/consultantList" //(服务)一对一 #define JT_consultantDetail @"open/app/service/consultantDetail" //(服务)咨询师详情 #define JT_getBusinessProject @"open/app/service/getBusinessProject" //(服务)获取品类下项目 #define JT_synBindingAccount @"app/user/synBindingAccount" //绑定极光账号 #define JT_indext @"open/app/user/index" //(淘信)APP首页消息 #define JT_getImagers @"open/app/service/getImagers" //(服务)服务轮播图 #define JT_toAddIntention @"app/order/toAddIntention" //进入添加意向订单 #define JT_addIntention @"app/order/addIntention" //添加意向订单 #define JT_orderList @"app/order/orderList" //查询意向列表(订单列表通用) #define JT_fundingHistory @"app/order/fundingHistory" //查询支付流水 #define JT_applyForCancel @"app/order/applyForCancel" //取消订单 #define JT_payForFirst @"app/order/payForFirst" //支付首付 #define JT_payForLast @"app/order/payForLast" //支付尾款 #define JT_confirmIntention @"app/order/confirmIntention" //确认意向订单 #define JT_applyForWithdraw @"app/order/applyForWithdraw" //提现 #define JT_orderDetails @"app/order/orderDetails" //查看订单详情 #define JT_advertising @"open/app/discovery/advertising" //发现模块广告推荐信息 #define JT_fundingHistory @"app/order/fundingHistory" //查询支付流水 #define JT_ProjectDetail @"open/app/service/ProjectDetail" //项目详情 #define JT_getField @"app/user/getField" //获取行业类型 #define JT_uploadPicture @"app/user/uploadPicture" //上传成果、需求图片 #define JT_appAddAchievement @"app/user/appAddAchievement" //发布成果 #define JT_appAddDemand @"app/user/appAddDemand" //发布需求 #define JT_getHomePageData @"open/app/home/getHomePageData" //获取首页数据 #define JT_getHomeRecommended @"open/app/home/getHomeRecommended" //获取首页技淘推荐 #define JT_applyForRefund @"app/order/applyForRefund" //申请退款 #define JT_confirmRefund @"app/order/confirmRefund" //同意/拒绝退款 /* ----------------------------------------------------------------------------------- --------------------------------------新版本API-------------------------------------- ----------------------------------------------------------------------------------- */ #define JT_NeworderList @"app/user/orderList"//我的订单列表 #define JT_NewapplyComment @"app/order/applyComment"//新增评价 #define JT_NewappMyInterested @"app/user/appMyInterested"//我的关注 #define JT_NewappMyCollection @"app/user/appMyCollection"//我的收藏 #define JT_NewappAchievementList @"app/user/appAchievementList"//我的成果列表 #define JT_NewappdemandList @"app/user/demandList"//我的需求列表 #define JT_NewlistPolicy @"open/app/discovery/listPolicy"//政策列表(详情直调数据) #define JT_NewlistInformation @"open/app/discovery/listInformation"//资讯列表(详情直调数据) #define JT_NewlistEncyclopedia @"open/app/discovery/listEncyclopedia"//资产百科(详情直调数据) #define JT_NewlistJtViewpoint @"open/app/discovery/listJtViewpoint"// #define JT_NewconsultantList @"open/app/discovery/consultantList"//顾问列表 #define JT_NewexpertsDetail @"open/app/user/expertsDetail"//专家、顾问详情 #define JT_NewprojectComment @"open/app/home/projectComment"//项目评价 #define JT_NewgetHomeData @"open/app/home/getHomeData"//获取首页数据 #define JT_NewrecommendedApplication @"open/app/home/recommendedApplication"//赚钱首页 #define JT_NewdemandDetail @"open/app/user/demandDetail"//需求详情 #define JT_NewachievementDetail @"open/app/user/achievementDetail"//成果详情 #define JT_NewsubmitOrder @"app/order/submitOrder"//提交订单 #define JT_NewsubmitConsultOrder @"app/order/submitConsultOrder"//专家、顾问订单提交 #define JT_NewexpertsComment @"open/app/user/expertsComment"//专家 顾问评价 #define JT_NewindustryList @"open/industryList"//获取行业列表 #define JT_NewachievementList @"open/app/discovery/achievementList"//成果列表 #define JT_NewdemandList @"open/app/discovery/demandList"//需求列表 #define JT_NewprojectLis @"open/app/home/projectList"//项目列表 #define JT_NewexpertsList @"open/app/discovery/expertsList"//专家列表 #define JT_NewcategoryList @"open/app/home/categoryList"//赚钱更多分类 #define JT_NewupdateDemand @"app/user/updateDemand"//修改需求 #define JT_NewupdateAchievement @"app/user/updateAchievement"//修改成果 #define JT_NewappAddAchievement @"app/user/appAddAchievement"//发布成果 #define JT_NewappAddDemand @"app/user/appAddDemand"//发布需求 #define JT_NewprojectDetail @"open/app/home/projectDetail"//项目详情 #define JT_NewprojectComment @"open/app/home/projectComment"//项目评价 #define JT_NewinterestAdd @"app/user/interestAdd"//关注功能 #define JT_NewgetCategoryList @"open/app/home/getCategoryList"//知识产权更多分类 #define JT_NewapplistMessage @"app/user/applistMessage"//我的消息列表 #define JT_NewreadMessage @"app/user/appReadMessage"//消息详情 /* ----------------------------------------------------------------------------------- --------------------------------------常用的宏-------------------------------------- ----------------------------------------------------------------------------------- */ //第三方代码计算出的获取唯一设备标识符 #define NewUDID [OpenUDID value] //WebView加载超时计时时间 #define WebViewOverTimeMark 60.0f //录音音量 1~10 #define NewAudioVolume 10.0f //轮播图片时长 #define CarouselTime 3.0f //普通轮播图片高度 #define headwheelHeight fitScreenHeight(179) #define homeHeadImageHEIGHT fitScreenWidth(188) //首页轮播图片高度 /** * Version */ #define ISIOS7 ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0f)//系统版本号 #define isPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)//判断iPhone和iPad /** * 屏幕高度 */ #define NavHeader [NewUtils navHeader] #define TABBAR_HEIGHT [NewUtils navTABBAR_HEIGHT] //菜单栏高 #define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width //屏幕宽度 #define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height //屏幕高度 //#define TABBAR_HEIGHT 49.0 //菜单栏高 #define NAV_HEIGHT 44.0 //导航栏高 #define STATUSBAR_HEIGHT 20.0 //状态栏 #define ViewStartY [NewUtils navHeader] //导航条高度 #define SELF_VIEW_HEIGHT (SCREEN_HEIGHT-ViewStartY) //不算导航条的高度 #define fitScreenWidth(width) width*(SCREEN_WIDTH/375) #define fitScreenHeight(height) height*(SCREEN_HEIGHT/667) #define SafeAreaTopHeight (SCREEN_WIDTH == 812.0 ? 88 : 64) #define ICONS_WIDTH 16.0 //小图标宽 #define ICONS_HEIGHT 22.0 //小图标高 /** * 自定义颜色 */ #define NewRGBColor(R,G,B,A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A]//16进制颜色值 //iOS10 苹果官方提供的sRGB #define NewS1RGBColor(R,G,B,A) [UIColor colorWithDisplayP3Red:R/255.0 green:G/255.0 blue:B/255.0 alpha:A] #define NewS2RGBColor(R,G,B,A) [UIColor initWithDisplayP3Red:R/255.0 green:G/255.0 blue:B/255.0 alpha:A] //+ (UIColor *)colorWithDisplayP3Red:(CGFloat)displayP3Red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha NS_AVAILABLE_IOS(10_0); //- (UIColor *)initWithDisplayP3Red:(CGFloat)displayP3Red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha NS_AVAILABLE_IOS(10_0); //16进制颜色转换 //#define UIColorFromRGBA(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 NewClearColor [UIColor clearColor] //无 #define NewWhiteColor [UIColor whiteColor] //白 #define NewBlackColor [UIColor blackColor] //黑 #define NewPurpleColor [UIColor purpleColor]//紫 #define NewRedColor [UIColor redColor] //红 #define NewYellowColor [UIColor yellowColor]//黄 #define NewOrangeColor [UIColor orangeColor]//橙 #define NewBlueColor [UIColor blueColor]//蓝 #define NewLightGrayColor [UIColor lightGrayColor]//深灰 #define NewCellLineColor NewRGBColor(200, 199, 204, 1) //单元格的Cell横线颜色 宽度约为0.6 #define NewIphoneNumberColor NewRGBColor(0, 136, 232, 1) //电话字体颜色 #define NewGroupTableViewBackgroundColor [UIColor groupTableViewBackgroundColor] //浅灰 //#define NewButtonColor [UIColor colorWithRed:255.0/255.0 green:150.0/255.0 blue:38.0/255.0 alpha:1.0] //常用按钮浅橙色 UIColorFromRGBA(0xff9626) #define NewButtonColor [UIColor colorWithString:@"#26A8F7"] #define NewNavigationColor [UIColor colorWithRed:236.0/255.0 green:236.0/255.0 blue:236.0/255.0 alpha:1.0] //导航条灰色 UIColorFromRGBA(0xf8c392) //#define NewNavigationColor [UIColor colorWithString:@"#FF0000"]//导航条 #define NewThemeColor [UIColor colorWithRed:239.0/255.0 green:51.0/255.0 blue:83.0/255.0 alpha:1.0] //#define NewLineGrayColor [UIColor colorWithRed:229.0/255 green:229.0/255 blue:229.0/255 alpha:1.0] //灰线 #define NewLineGrayColor [UIColor colorWithString:@"#F2F2F2"] #define NewBgGrayColor [UIColor colorWithRed:239.0/255 green:239.0/255 blue:244.0/255 alpha:1.0] //灰色背景 #define NewGrayColor [UIColor colorWithRed:105/255.0 green:105/255.0 blue:105/255.0 alpha:1.0] //灰 #define NewGray2Color [UIColor colorWithRed:171/255.0 green:171/255.0 blue:171/255.0 alpha:1.0] //浅灰 #define NewDarkGrayColor [UIColor colorWithRed:46/255.0 green:46/255.0 blue:46/255.0 alpha:1.0] //深灰 #define NewImgBgColor [UIColor colorWithRed:238.0/255.0 green:238.0/255.0 blue:238.0/255.0 alpha:1.0] #define NewNoDataColor [UIColor colorWithRed:167.0/255.0 green:174.0/255.0 blue:186.0/255.0 alpha:1.0] //无数据字体颜色 /** * View 圆角和加边框 */ #define ViewBorderRadius(View, Radius, Width, Color)\ \ [View.layer setCornerRadius:(Radius)];\ [View.layer setMasksToBounds:YES];\ [View.layer setBorderWidth:(Width)];\ [View.layer setBorderColor:[Color CGColor]] /** * View 圆角 */ #define ViewRadius(View, Radius)\ \ [View.layer setCornerRadius:(Radius)];\ [View.layer setMasksToBounds:YES] /** * 字体 */ #define NewFont(fontSize) [UIFont systemFontOfSize:fontSize]//细体字号 #define NewBFont(fontSize) [UIFont boldSystemFontOfSize:fontSize]//粗体字号 #define ChangeProportion (SCREEN_WIDTH/320.0) #define NewAutoFont(fontSize) ChangeProportion>1?NewFont(fontSize+2):NewFont(fontSize)//根据屏幕宽度返回细字体 #define NewBAutoFont(fontSize) ChangeProportion>1?NewBFont(fontSize+2):NewBFont(fontSize)//根据屏幕宽度返回粗字体 /** * 字符串拼接 */ #define NewStringFormat(xfmt, ...) [NSString stringWithFormat:xfmt, ##__VA_ARGS__] /** * 字符串比较 */ #define NewEqualString(xParameter1, xParameter2) [xParameter1 isEqualToString:xParameter2] /** * 对象初始化 */ #define NewInit(xClass) [[xClass alloc] init] #define NewInitWithName(xClass,initName) xClass *initName = NewInit(xClass) /** * MutableArrayInit 可变数组初始化 */ #define NewMutableArrayInit [NSMutableArray array] /** * MutableDictionaryInit 可变字典初始化 */ #define NewMutableDictionaryInit [NSMutableDictionary dictionary] /** * 对象初始化且添加Frame */ #define NewInitWithParameter(xClass,initName,xInitFrame) xClass *initName = [[xClass alloc] initWithFrame:xInitFrame] /** * Frame */ #define NewFrame(xmx,xmy,xw,xh) CGRectMake(xmx,xmy,xw,xh) /** * Button点击事件 */ #define NewTouchUpInside(touchName,touchAction) [touchName addTarget:self action:@selector(touchAction) forControlEvents:UIControlEventTouchUpInside] /** * UIImage初始化 */ #define NewImageNamed(imageNameString) [UIImage imageNamed:imageNameString] /** * UIImageView初始化且添加图片 */ #define NewImgInit(xClass,initName,pImg) xClass *initName = [[xClass alloc] initWithImage:pImg] /** * SafeRelease MRC状态下手动释放内存 */ #define SafeRelease(A) [A release];A=nil; /** * SafeString */ #define NewSafeString(source) (([source isKindOfClass:[NSNull class]]?@"":source) == nil?@"":(NSString*)source) /** * StringSizeWith * * @param xString 自定义字体以及字体大小 * @param xFont * * @return StringSize */ #define NewStringSizeWith(xString,xFont) [xString sizeWithFont:xFont] #define NewStringSize(xString,xFont) [xString sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:xFont, NSFontAttributeName, nil]] /** * Push Present */ #define NewPushViewController(xClass) [self.navigationController pushViewController:xClass animated:YES] //普通push #define NewPopViewController [self.navigationController popViewControllerAnimated:YES] //普通返回到上一级 #define NewPopToRootViewController [self.navigationController popToRootViewControllerAnimated:YES] //返回到最顶层 #define NewPresentViewController(xClass) [self presentViewController:xClass animated:YES completion:nil] //普通present #define NewDismissViewController [self dismissViewControllerAnimated:YES completion:nil] //普通dismiss返回 #define NewPresentNavigationController(xClass) [self.navigationController presentViewController:[[UINavigationController alloc] initWithRootViewController:xClass] animated:YES completion:nil] //带导航条的present #define NewDismissNavigationController [self.navigationController dismissViewControllerAnimated:YES completion:nil] //带导航条的dismiss返回 /** * DEBUG输出日志 */ /* #ifdef DEBUG #define NSLog(...) NSLog(@"%s 第%d行 \n%@",__func__,__LINE__,[NSString stringWithFormat:__VA_ARGS__]) #else #define NSLog(...) #endif */ /* #ifdef DEBUG #define NSLog(...) NSLog(__VA_ARGS__) #define debugMethod() NSLog(@"%s",__func__) //// #else #define NSLog(...) #define debugMethod() #endif */ /* #ifdef DEBUG #define LRString [NSString stringWithFormat:@"%s", __FILE__].lastPathComponent #define LRLog(...) printf("%s: %s 第%d行: %s\n\n",[[NSString lr_stringDate] UTF8String], [LRString UTF8String] ,__LINE__, [[NSString stringWithFormat:__VA_ARGS__] UTF8String]); #else #define LRLog(...) #endif */ /** * NSURL */ #define NewURL(NewImageUrl) [NSURL URLWithString:NewImageUrl] /** * 用户默认头像 */ #define NewUserImage [UIImage imageNamed:@"NewDefaultHeadPortrait"] /** * 个人中心头视图 */ #define NewDefaultHead [UIImage imageNamed:@"NewDefaultHead"] /** * 用户未激活提示语 */ #define NewNoActivedTitle @"很抱歉,您的账号尚未激活!" #define NewNoActivedHUD [SVProgressHUD showInfoWithStatus:NewNoActivedTitle] /** * 默认连接服务器失败/无数据提示语 */ #define NewConnectServerErrorTitle @"很遗憾,网络连接失败了!" #define NewConnectServerReloadTitle @"重新加载" #define NewConnectServerNoDataTitle @"没有数据哦!" #define NewConnectServerRefreshTitle @"刷新" #define NewConnectServerNoMoreDataTitle @"数据已经加载完毕" /** * 默认网络错误图片 */ #define NewetworkErrorImage @"NewNetworkError" /** * 默认无网络数据图片 */ #define NewNoDataErrorImage @"消息为空" /** * 默认无视频图片 */ #define NewNoVideoErrorImage @"NewNoVideoError" /** * 默认的加载失败之后呈现的图片 */ #define NewImageError_J [UIImage imageNamed:@"imageError_J"] //正 #define NewImageError_T [UIImage imageNamed:@"imageError_T"] //横 #define NewImageError_V [UIImage imageNamed:@"imageError_V"] //竖 #define NewImageError_C [UIImage imageNamed:@"imageError_C"] //圆 /** * 沙盒目录文件 //获取temp #define NewPathTemp NSTemporaryDirectory() //获取沙盒 Document #define NewPathDocument [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] //获取沙盒 Cache #define NewPathCache [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject] */ /** * GCD 的宏定义 使用的时候 -> xDISPATCH_ONCE_BLOCK(^{这里面写代码}); //GCD - 一次性执行 #define NewDISPATCH_ONCE_BLOCK(onceBlock) static dispatch_once_t onceToken; dispatch_once(&onceToken, onceBlock); //GCD - 在Main线程上运行 #define NewDISPATCH_MAIN_THREAD(mainQueueBlock) dispatch_async(dispatch_get_main_queue(), mainQueueBlock); //GCD - 开启异步线程 #define NewDISPATCH_GLOBAL_QUEUE_DEFAULT(globalQueueBlock) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), globalQueueBlocl); */