NYMacros.swift 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. ///------
  15. /// iOS Version
  16. ///------
  17. static let iOSVersion = Float(UIDevice.current.systemVersion) ?? 0.0
  18. static let iOS7OrLater = iOSVersion >= 7.0
  19. static let iOS8OrLater = iOSVersion >= 8.0
  20. static let iOS9OrLater = iOSVersion >= 9.0
  21. static let iOS10OrLater = iOSVersion >= 10.0
  22. static let iOS11OrLater = iOSVersion >= 11.0
  23. static let iOS12OrLater = iOSVersion >= 12.0
  24. static let iOS13OrLater = iOSVersion >= 13.0
  25. static let iOS14OrLater = iOSVersion >= 14.0
  26. static let iOS15OrLater = iOSVersion >= 15.0
  27. // //时间戳
  28. // static func t() -> String {
  29. // return String(format: "%.f", Date().timeIntervalSince1970)
  30. // }
  31. // static func ts() -> String {
  32. // return String(format: "%.f", Date().timeIntervalSince1970*1000)
  33. // }
  34. // //生成设备ID
  35. // static func deviceID() -> String {
  36. // var deviceIDStr: String? = nil
  37. // if deviceIDStr == nil {
  38. // deviceIDStr = SAMKeychain.deviceId()
  39. // }
  40. // return deviceIDStr?.isEmpty == false ? deviceIDStr! : ""
  41. // }
  42. }