diff --git a/KnotClock.xcodeproj/project.pbxproj b/KnotClock.xcodeproj/project.pbxproj index fe413d3..b6a1824 100644 --- a/KnotClock.xcodeproj/project.pbxproj +++ b/KnotClock.xcodeproj/project.pbxproj @@ -475,7 +475,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = KnotClock/KnotClock.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 8; DEVELOPMENT_ASSET_PATHS = "\"KnotClock/Preview Content\""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -494,7 +494,7 @@ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 0.4.0; + MARKETING_VERSION = 0.5.0; PRODUCT_BUNDLE_IDENTIFIER = com.nascv.KnotClock; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; @@ -512,7 +512,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = KnotClock/KnotClock.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 8; DEVELOPMENT_ASSET_PATHS = "\"KnotClock/Preview Content\""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -531,7 +531,7 @@ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 0.4.0; + MARKETING_VERSION = 0.5.0; PRODUCT_BUNDLE_IDENTIFIER = com.nascv.KnotClock; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; diff --git a/KnotClock/Classes/Alerts.swift b/KnotClock/Classes/Alerts.swift index 90f4ab4..9759ba0 100644 --- a/KnotClock/Classes/Alerts.swift +++ b/KnotClock/Classes/Alerts.swift @@ -10,6 +10,8 @@ import Foundation class Alerts: ObservableObject { static let shared = Alerts() + private init() {} + @Published var message = "" @Published var isPresented = false diff --git a/KnotClock/Classes/Countdowns.swift b/KnotClock/Classes/Countdowns.swift index 69fd179..239ff38 100644 --- a/KnotClock/Classes/Countdowns.swift +++ b/KnotClock/Classes/Countdowns.swift @@ -31,7 +31,7 @@ class Countdowns: ObservableObject { private var oldTimerInterval: Double? = nil private var lastRefetchDay: Int = 0 - init() { + private init() { rescheduleTimer(interval: preferences.x.refreshTimerInterval) } diff --git a/KnotClock/Classes/DataController.swift b/KnotClock/Classes/DataController.swift index 83e67d7..123da0e 100644 --- a/KnotClock/Classes/DataController.swift +++ b/KnotClock/Classes/DataController.swift @@ -17,6 +17,7 @@ class DataController: ObservableObject { load() } + func reload() { load() } func load() { container.loadPersistentStores { description, error in if let error { @@ -24,10 +25,6 @@ class DataController: ObservableObject { } } } - - func reload() { - load() - } } extension Daily { diff --git a/KnotClock/Classes/Notifications.swift b/KnotClock/Classes/Notifications.swift index c48666f..bb4e796 100644 --- a/KnotClock/Classes/Notifications.swift +++ b/KnotClock/Classes/Notifications.swift @@ -11,6 +11,8 @@ import UserNotifications class Notifications: ObservableObject { static let shared = Notifications() + private init() {} + @AppStorage(K.StorageKeys.userPreferences) private var preferences = Preferences(x: DefaultUserPreferences()) @Published private(set) var notificationsTotalCount = 0