project reorg
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
CD8ACBBF2DC5B8F2008BF856 /* Exceptions for "QueueCube" folder in "QueueCube" target */ = {
|
||||
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
|
||||
membershipExceptions = (
|
||||
Info.plist,
|
||||
App/Info.plist,
|
||||
);
|
||||
target = CD4E9B962D7691C20066FC17 /* QueueCube */;
|
||||
};
|
||||
@@ -271,7 +271,7 @@
|
||||
DEVELOPMENT_TEAM = DQQH5H6GBD;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = QueueCube/Info.plist;
|
||||
INFOPLIST_FILE = QueueCube/App/Info.plist;
|
||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
||||
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
|
||||
@@ -306,7 +306,7 @@
|
||||
DEVELOPMENT_TEAM = DQQH5H6GBD;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = QueueCube/Info.plist;
|
||||
INFOPLIST_FILE = QueueCube/App/Info.plist;
|
||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
||||
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
|
||||
|
||||
35
QueueCube/Backend/Settings.swift
Normal file
35
QueueCube/Backend/Settings.swift
Normal file
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Settings.swift
|
||||
// QueueCube
|
||||
//
|
||||
// Created by James Magahern on 6/10/25.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct Settings
|
||||
{
|
||||
var serverURL: String?
|
||||
|
||||
static func fromDefaults() -> Settings {
|
||||
let serverURL = UserDefaults.standard.string(forKey: Keys.serverURL.rawValue)
|
||||
return Settings(serverURL: serverURL)
|
||||
}
|
||||
|
||||
func save() {
|
||||
UserDefaults.standard.set(serverURL, forKey: Keys.serverURL.rawValue)
|
||||
NotificationCenter.default.post(name: .settingsChanged, object: nil)
|
||||
}
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
enum Keys: String
|
||||
{
|
||||
case serverURL
|
||||
}
|
||||
}
|
||||
|
||||
extension Notification.Name
|
||||
{
|
||||
static let settingsChanged = Notification.Name("settingsChanged")
|
||||
}
|
||||
@@ -7,33 +7,6 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
struct Settings
|
||||
{
|
||||
var serverURL: String?
|
||||
|
||||
static func fromDefaults() -> Settings {
|
||||
let serverURL = UserDefaults.standard.string(forKey: Keys.serverURL.rawValue)
|
||||
return Settings(serverURL: serverURL)
|
||||
}
|
||||
|
||||
func save() {
|
||||
UserDefaults.standard.set(serverURL, forKey: Keys.serverURL.rawValue)
|
||||
NotificationCenter.default.post(name: .settingsChanged, object: nil)
|
||||
}
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
enum Keys: String
|
||||
{
|
||||
case serverURL
|
||||
}
|
||||
}
|
||||
|
||||
extension Notification.Name
|
||||
{
|
||||
static let settingsChanged = Notification.Name("settingsChanged")
|
||||
}
|
||||
|
||||
extension Optional
|
||||
{
|
||||
func try_unwrap() throws -> Wrapped {
|
||||
Reference in New Issue
Block a user