mirror of
https://github.com/zydeco/minivmac4ios.git
synced 2024-11-15 19:08:42 +00:00
make AppDelegate a bit swifty
This commit is contained in:
parent
3b96faf502
commit
22256824d2
@ -23,8 +23,8 @@ extern NSString *DocumentsChangedNotification;
|
||||
@property (readonly, nonatomic, getter = isSandboxed) BOOL sandboxed;
|
||||
@property (readonly, nonatomic) id<Emulator> sharedEmulator;
|
||||
|
||||
+ (instancetype)sharedInstance;
|
||||
+ (id<Emulator>)sharedEmulator;
|
||||
@property (class, readonly, strong) AppDelegate *sharedInstance NS_SWIFT_NAME(shared);
|
||||
@property (class, readonly, strong) id<Emulator> sharedEmulator NS_SWIFT_NAME(emulator);
|
||||
- (void)loadAndStartEmulator;
|
||||
|
||||
- (void)showAlertWithTitle:(NSString *)title message:(NSString *)message;
|
||||
|
@ -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")
|
||||
}
|
||||
|
||||
|
@ -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")
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user