Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
npna committed Mar 15, 2023
1 parent 330479e commit 849b7a8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions KnotClock.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions KnotClock/Classes/Alerts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import Foundation
class Alerts: ObservableObject {
static let shared = Alerts()

private init() {}

@Published var message = ""
@Published var isPresented = false

Expand Down
2 changes: 1 addition & 1 deletion KnotClock/Classes/Countdowns.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
5 changes: 1 addition & 4 deletions KnotClock/Classes/DataController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ class DataController: ObservableObject {
load()
}

func reload() { load() }
func load() {
container.loadPersistentStores { description, error in
if let error {
fatalError("Error when loading CoreData: \(error.localizedDescription)")
}
}
}

func reload() {
load()
}
}

extension Daily {
Expand Down
2 changes: 2 additions & 0 deletions KnotClock/Classes/Notifications.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 849b7a8

Please sign in to comment.