NYMacros.swift 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // NYMacros.swift
  3. // JSJP_Student_sw
  4. //
  5. // Created by Ning.ge on 2023/6/6.
  6. //
  7. struct NYMacros {
  8. //应用名
  9. static let appName = Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName")
  10. //应用版本
  11. static let appVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString")
  12. //应用build
  13. static let appBuild = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion")
  14. //友盟key
  15. static let appMenKey = "648bf1ac87568a379b57b0cd"
  16. ///------
  17. /// iOS Version
  18. ///------
  19. static let iOSVersion = Float(UIDevice.current.systemVersion) ?? 0.0
  20. static let iOS7OrLater = iOSVersion >= 7.0
  21. static let iOS8OrLater = iOSVersion >= 8.0
  22. static let iOS9OrLater = iOSVersion >= 9.0
  23. static let iOS10OrLater = iOSVersion >= 10.0
  24. static let iOS11OrLater = iOSVersion >= 11.0
  25. static let iOS12OrLater = iOSVersion >= 12.0
  26. static let iOS13OrLater = iOSVersion >= 13.0
  27. static let iOS14OrLater = iOSVersion >= 14.0
  28. static let iOS15OrLater = iOSVersion >= 15.0
  29. // //时间戳
  30. // static func t() -> String {
  31. // return String(format: "%.f", Date().timeIntervalSince1970)
  32. // }
  33. // static func ts() -> String {
  34. // return String(format: "%.f", Date().timeIntervalSince1970*1000)
  35. // }
  36. // //生成设备ID
  37. // static func deviceID() -> String {
  38. // var deviceIDStr: String? = nil
  39. // if deviceIDStr == nil {
  40. // deviceIDStr = SAMKeychain.deviceId()
  41. // }
  42. // return deviceIDStr?.isEmpty == false ? deviceIDStr! : ""
  43. // }
  44. }