diff --git a/Mini vMac/AppDelegate.h b/Mini vMac/AppDelegate.h index 1884bf0..6b23356 100644 --- a/Mini vMac/AppDelegate.h +++ b/Mini vMac/AppDelegate.h @@ -23,8 +23,8 @@ extern NSString *DocumentsChangedNotification; @property (readonly, nonatomic, getter = isSandboxed) BOOL sandboxed; @property (readonly, nonatomic) id sharedEmulator; -+ (instancetype)sharedInstance; -+ (id)sharedEmulator; +@property (class, readonly, strong) AppDelegate *sharedInstance NS_SWIFT_NAME(shared); +@property (class, readonly, strong) id sharedEmulator NS_SWIFT_NAME(emulator); - (void)loadAndStartEmulator; - (void)showAlertWithTitle:(NSString *)title message:(NSString *)message; diff --git a/Mini vMac/DefaultSceneDelegate.swift b/Mini vMac/DefaultSceneDelegate.swift index 62a222c..516c054 100644 --- a/Mini vMac/DefaultSceneDelegate.swift +++ b/Mini vMac/DefaultSceneDelegate.swift @@ -15,7 +15,7 @@ class DefaultSceneDelegate: UIResponder, UIWindowSceneDelegate { guard let windowScene = scene as? UIWindowScene else { fatalError("Expected scene of type UIWindowScene but got an unexpected type") } - guard let appDelegate = AppDelegate.sharedInstance() else { + guard let appDelegate = AppDelegate.shared else { fatalError("No app delegate") } diff --git a/Mini vMac/KeyboardSceneDelegate.swift b/Mini vMac/KeyboardSceneDelegate.swift index b780975..43940ec 100644 --- a/Mini vMac/KeyboardSceneDelegate.swift +++ b/Mini vMac/KeyboardSceneDelegate.swift @@ -15,7 +15,7 @@ class KeyboardSceneDelegate: UIResponder, UIWindowSceneDelegate { guard let windowScene = scene as? UIWindowScene else { fatalError("Expected scene of type UIWindowScene but got an unexpected type") } - guard let mainViewController = AppDelegate.sharedInstance().window.rootViewController as? ViewController else { + guard let mainViewController = AppDelegate.shared.window.rootViewController as? ViewController else { fatalError("No main view controller") } diff --git a/Mini vMac/VisionSupport.swift b/Mini vMac/VisionSupport.swift index 1379de9..377ac50 100644 --- a/Mini vMac/VisionSupport.swift +++ b/Mini vMac/VisionSupport.swift @@ -21,13 +21,13 @@ extension ViewController { Spacer(minLength: 80.0) HStack { Button(action: { - AppDelegate.sharedInstance().showSettings(self) + AppDelegate.shared.showSettings(self) }, label: { Image(systemName: "gear") }).glassBackgroundEffect() Button(action: { - AppDelegate.sharedInstance().showInsertDisk(self) + AppDelegate.shared.showInsertDisk(self) }, label: { Image(systemName: "opticaldiscdrive") }).glassBackgroundEffect() @@ -46,7 +46,7 @@ extension ViewController { @objc static func adjustToScreenSize() { - let screenSize = AppDelegate.sharedEmulator().screenSize + let screenSize = AppDelegate.emulator.screenSize guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene else { return }