Public should not be used in an app since it declares public to additional modules. However, an app is one module. Some structs/ classes need to be left public to conform to CoreData's generation. Signed-off-by: kingbri <bdashore3@proton.me>
47 lines
1.2 KiB
Swift
47 lines
1.2 KiB
Swift
//
|
|
// Application.swift
|
|
// Ferrite
|
|
//
|
|
// Created by Brian Dashore on 9/16/22.
|
|
//
|
|
// A thread-safe UIApplication alternative for specifying app properties
|
|
//
|
|
|
|
import Foundation
|
|
|
|
class Application {
|
|
static let shared = Application()
|
|
|
|
// OS name for Plugins to read. Lowercase for ease of use
|
|
let os = "ios"
|
|
|
|
// Minimum OS version that Ferrite runs on
|
|
var minVersion: String {
|
|
Bundle.main.object(forInfoDictionaryKey: "MinimumOSVersion") as? String ?? "0.0"
|
|
}
|
|
|
|
// Grabs the current user's OS version
|
|
let osVersion: OperatingSystemVersion = ProcessInfo().operatingSystemVersion
|
|
|
|
// Application version and build variables
|
|
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
|
|
}
|
|
}
|