For versions that require iOS 15 and up, don't notify previous iOS 14 users about a new update. This requires a minVersion attribute in the shared Application class. Signed-off-by: kingbri <bdashore3@proton.me>
39 lines
973 B
Swift
39 lines
973 B
Swift
//
|
|
// Application.swift
|
|
// Ferrite
|
|
//
|
|
// Created by Brian Dashore on 9/16/22.
|
|
//
|
|
// A thread-safe UIApplication alternative for specifying app properties
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public class Application {
|
|
static let shared = Application()
|
|
|
|
let minVersion = OperatingSystemVersion(majorVersion: 14, minorVersion: 0, patchVersion: 0)
|
|
|
|
var appVersion: String {
|
|
Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "0.0.0"
|
|
}
|
|
|
|
var appBuild: String {
|
|
Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? "0"
|
|
}
|
|
|
|
// Debug = development, Nightly = actions, Release = stable
|
|
var buildType: String {
|
|
#if DEBUG
|
|
return "Debug"
|
|
#else
|
|
if Bundle.main.isNightly {
|
|
return "Nightly"
|
|
} else {
|
|
return "Release"
|
|
}
|
|
#endif
|
|
}
|
|
|
|
let osVersion: OperatingSystemVersion = ProcessInfo().operatingSystemVersion
|
|
}
|