swift 类似macro


swift 中类似宏定义使用


//

//  WFCommon.swift

//  Swift_02



import Foundation

import UIKit



//MARK:-------------------------------------------------------------------------

// 系统版本

public let DeviceSystemVersion:String = UIDevice.currentDevice().systemVersion

public let IsDeviceVersionIOS6:Bool = Float(UIDevice.currentDevice().systemVersion)<7.0

public let IsDeviceVersionIOS7:Bool = Float(UIDevice.currentDevice().systemVersion)>=7.0

public let IsDeviceVersionIOS8:Bool = Float(UIDevice.currentDevice().systemVersion)>=8.0

public let IsDeviceVersionIOS9:Bool = Float(UIDevice.currentDevice().systemVersion)>=9.0

public let IsDeviceVersionIOS10:Bool = Float(UIDevice.currentDevice().systemVersion)>=10.0


//public let ContentViewOffsetY:Float = IsDeviceVersionIOS7 ? 64.0 : 0.0


// 尺寸

public let SCREEN_WIDTH = UIScreen.mainScreen().bounds.size.width

public let SCREEN_HEIGHT = UIScreen.mainScreen().bounds.size.height



// 设备名称

public let iPhone6P:Bool = (UIScreen.instancesRespondToSelector(Selector("currentMode")) ? CGSizeEqualToSize(CGSizeMake(1242, 2208), (UIScreen.mainScreen().currentMode?.size)!) : false)

public let iPhone6:Bool = (UIScreen.instancesRespondToSelector(Selector("currentMode")) ? CGSizeEqualToSize(CGSizeMake(750, 1334), (UIScreen.mainScreen().currentMode?.size)!) : false)

public let iPhone5:Bool = (UIScreen.instancesRespondToSelector(Selector("currentMode")) ? CGSizeEqualToSize(CGSizeMake(640, 1136), (UIScreen.mainScreen().currentMode?.size)!) : false)


public let isPad:Bool = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.Pad)


// 是否高清屏

public let isDeviceRetina: Bool = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.Pad ? (UIScreen.instancesRespondToSelector(Selector("currentMode")) ? CGSizeEqualToSize(CGSizeMake(1536, 2048), (UIScreen.mainScreen().currentMode?.size)!) : false) : (UIScreen.instancesRespondToSelector(Selector("currentMode")) ? UIScreen.mainScreen().currentMode?.size.width > 320 : false)



//MARK:-------------------------------------------------------------------------

// 主题色

public let TITLE_TEXTCOLOR = UIColor.init(red: 36/255.0, green: 38/255.0, blue: 40/255.0, alpha: 1.0)

public let DESC_TEXTCOLOR = UIColor.init(red: 138/255.0, green: 142/255.0, blue: 150/255.0, alpha: 1.0)

public let NAV_BAR_COLOR_1 = UIColor(red: 60/255.0, green: 68/255.0, blue: 94/255.0, alpha: 1.0)

public let NAV_BAR_COLOR_2 = UIColor(red: 255/255.0, green: 255/255.0, blue: 255/255.0, alpha: 1.0)






//MARK:-------------------------------------------------------------------------

// 友盟APPKey

public let UM_APPKey = (isPad ? "aa" : "ss")

public let UM_WXAppId = ""

public let UM_WXAppKey = ""

public let UM_QQAppId = ""

public let UM_QQAppKey = ""

public let UM_SinaAppId = ""

public let UM_SinaAppKey = ""

public let UM_FaveBookAppId = ""

public let UM_TwitterAppId = ""

public let UM_TwitterAppKey = ""


// 高德地图key - 正式环境

public let GD_APPKEY_STORE = ""

// 高德地图key - 测试环境

public let GD_APPKEY_TEST = ""


// 百度应用APIKey

public let BD_APIKEY = ""


// Bugtags APIKey

public let Bugtags_APIKEY = ""





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值