// AppConfig.h
創(chuàng)建一個(gè).h文件作為全局設(shè)置
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#define DARK_BACKGROUND [UIColor colorWithPatternImage:[UIImage p_w_picpathNamed:@"tableview"]]
#define LIGHT_BACKGROUND [UIColor colorWithRed:250.0/255.0 green:250.0/255.0 blue:250.0/255.0 alpha:1.0]
#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]
//新浪微博設(shè)置
#define kSinaAppKey @"3835906094"
#define kSinaAppSecret @"f7efce5aec66546a192a55dc4ff0ca58"
#define kSinaAppRedirectURI @"http://sns.whalecloud.com/sina2/callback"
#define kSinaSSoCallbackScheme @"sinaweibosso.3835906094"
//騰訊微博設(shè)置
#define kQQAppKey @"3835906094"
#define kQQAppSecret @"f7efce5aec66546a192a55dc4ff0ca58"
#define kQQAppRedirectURI @"http://sns.whalecloud.com/sina2/callback"
//全局應(yīng)用
#define MyApp ((AppDelegate*)[[UIApplication sharedApplication] delegate])
//友盟統(tǒng)計(jì) -- 用戶
#define UMENG_APPKEY @"51b43bdf56240b6ef4009a3d"
//推廣渠道ID
#define APP_CHANNELID @"AppStore"
//AppStore, 91, Weiphone
//AppKey
//微信AppID:wx959223c1aec3c4aa
#define WEIXIN_APPID @"wx959223c1aec3c4aa"
//判斷是否為iPhone5
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
//判斷是否為iOS7
#define iOS7 ((floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1))
//判斷是否為iPad
static BOOL isDeviceIPad() {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
return YES;
}
#endif
return NO;
}
//文本對(duì)齊方式
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000
#define TextAlignmentCenter NSTextAlignmentCenter
#define TextAlignmentLeft NSTextAlignmentLeft
#define TextAlignmentRight NSTextAlignmentRight
#else
#define TextAlignmentCenter UITextAlignmentCenter
#define TextAlignmentLeft UITextAlignmentLeft
#define TextAlignmentRight UITextAlignmentRight
#endif
//文本截取方式
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000
#define LineBreakModeWordWrap NSLineBreakByWordWrapping
#define LineBreakModeCharacterWrap NSLineBreakByCharWrapping
#define LineBreakModeClip NSLineBreakByClipping
#define LineBreakModeHeadTruncation NSLineBreakByTruncatingHead
#define LineBreakModeTailTruncation NSLineBreakByTruncatingTail,
#define LineBreakModeMiddleTruncation NSLineBreakByTruncatingMiddle
#else
#define LineBreakModeWordWrap UILineBreakModeWordWrap
#define LineBreakModeCharacterWrap UILineBreakModeCharacterWrap
#define LineBreakModeClip UILineBreakModeClip
#define LineBreakModeHeadTruncation UILineBreakModeHeadTruncation
#define LineBreakModeTailTruncation UILineBreakModeTailTruncation
#define LineBreakModeMiddleTruncation UILineBreakMo
#endif
//下面的代碼是使用GCD的一個(gè)模板
//dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// // switch to a background thread and perform your expensive operation
//
// dispatch_async(dispatch_get_main_queue(), ^{
// // switch back to the main thread to update your UI
//
// });
//});
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
文章標(biāo)題:iOS全局變量設(shè)置-創(chuàng)新互聯(lián)
文章網(wǎng)址:http://aaarwkj.com/article34/cdhese.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站維護(hù)、ChatGPT、網(wǎng)站設(shè)計(jì)公司、品牌網(wǎng)站設(shè)計(jì)、網(wǎng)站收錄、網(wǎng)站導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容