Config.swift 622 B

123456789101112131415161718192021222324
  1. import Foundation
  2. enum Config {
  3. static var appBaseUrl: String {
  4. string(for: "AppBaseURL")
  5. }
  6. static var build: String {
  7. string(for: "CFBundleVersion")
  8. }
  9. static var version: String {
  10. string(for: "CFBundleShortVersionString")
  11. }
  12. static var osVersion: String {
  13. let os = ProcessInfo.processInfo.operatingSystemVersion
  14. return String(os.majorVersion) + "." + String(os.minorVersion) + "." + String(os.patchVersion)
  15. }
  16. static private func string(for key: String) -> String {
  17. Bundle.main.infoDictionary?[key] as! String
  18. }
  19. }