12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- //
- // NYMacros.swift
- // JSJP_Student_sw
- //
- // Created by Ning.ge on 2023/6/6.
- //
- struct NYMacros {
- //应用名
- static let appName = Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName")
- //应用版本
- static let appVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString")
- //应用build
- static let appBuild = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion")
- ///------
- /// iOS Version
- ///------
- static let iOSVersion = Float(UIDevice.current.systemVersion) ?? 0.0
- static let iOS7OrLater = iOSVersion >= 7.0
- static let iOS8OrLater = iOSVersion >= 8.0
- static let iOS9OrLater = iOSVersion >= 9.0
- static let iOS10OrLater = iOSVersion >= 10.0
- static let iOS11OrLater = iOSVersion >= 11.0
- static let iOS12OrLater = iOSVersion >= 12.0
- static let iOS13OrLater = iOSVersion >= 13.0
- static let iOS14OrLater = iOSVersion >= 14.0
- static let iOS15OrLater = iOSVersion >= 15.0
-
- // //时间戳
- // static func t() -> String {
- // return String(format: "%.f", Date().timeIntervalSince1970)
- // }
- // static func ts() -> String {
- // return String(format: "%.f", Date().timeIntervalSince1970*1000)
- // }
- // //生成设备ID
- // static func deviceID() -> String {
- // var deviceIDStr: String? = nil
- // if deviceIDStr == nil {
- // deviceIDStr = SAMKeychain.deviceId()
- // }
- // return deviceIDStr?.isEmpty == false ? deviceIDStr! : ""
- // }
- }
|