Implement comprehensive release notes feature: - RELEASE_NOTES.md with version 1.0 and 1.1 content in English - VersionManager to track app versions and detect updates - ReleaseNotesView with native markdown rendering - Auto-popup sheet on first launch after version update - Manual access via "What's New" button in General Settings Features: - Markdown-based release notes stored in app bundle - Automatic version detection using CFBundleShortVersionString - UserDefaults tracking of last seen version - Dismissable sheet with "Done" button - Settings button shows current version number Technical implementation: - VersionManager singleton for version tracking - Sheet presentation in MainTabView on new version - Settings integration with sparkles icon - Native SwiftUI Text markdown rendering - Bundle resource loading for RELEASE_NOTES.md Release notes content: - Version 1.1: iOS 26 features, floating buttons, progress tracking - Version 1.0: Initial release features and capabilities
39 lines
963 B
Swift
39 lines
963 B
Swift
import Foundation
|
|
|
|
class VersionManager {
|
|
static let shared = VersionManager()
|
|
|
|
private let lastSeenVersionKey = "lastSeenAppVersion"
|
|
private let userDefaults = UserDefaults.standard
|
|
|
|
var currentVersion: String {
|
|
Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "1.0"
|
|
}
|
|
|
|
var currentBuild: String {
|
|
Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? "1"
|
|
}
|
|
|
|
var fullVersion: String {
|
|
"\(currentVersion) (\(currentBuild))"
|
|
}
|
|
|
|
var lastSeenVersion: String? {
|
|
userDefaults.string(forKey: lastSeenVersionKey)
|
|
}
|
|
|
|
var isNewVersion: Bool {
|
|
guard let lastSeen = lastSeenVersion else {
|
|
// First launch
|
|
return true
|
|
}
|
|
return lastSeen != currentVersion
|
|
}
|
|
|
|
func markVersionAsSeen() {
|
|
userDefaults.set(currentVersion, forKey: lastSeenVersionKey)
|
|
}
|
|
|
|
private init() {}
|
|
}
|