Mulberry/ios/App/Services/AppVersion.swift
astar76 927219bf77 Add Mulberry for iOS (1.0.6) under ios/
SwiftUI port of the Android app with the desktop feature set; built on Linux,
linked and signed on a jailbroken iPhone. History imported from the standalone repo.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 23:23:51 -05:00

17 lines
819 B
Swift

import Foundation
/// Version info from Info.plist (set by build.sh from the VERSION file and the git commit count).
enum AppVersion {
static var version: String { Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "?" }
static var build: String { Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? "?" }
/// "Updated to x.y.z" once after an update (nil on first install or same version).
static func updateNote() -> String? {
let key = "last_version"
let now = "\(version) (\(build))"
let last = UserDefaults.standard.string(forKey: key)
UserDefaults.standard.set(now, forKey: key)
guard let last, last != now else { return nil }
return "Updated to Mulberry \(version) (build \(build))"
}
}