mirror of
https://github.com/zydeco/minivmac4ios.git
synced 2024-06-15 13:29:29 +00:00
fix quick actions
This commit is contained in:
parent
da3f639ef2
commit
19c0072d4c
|
@ -189,7 +189,7 @@ NSString *DocumentsChangedNotification = @"documentsChanged";
|
|||
|
||||
- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler {
|
||||
BOOL success = NO;
|
||||
if ([shortcutItem.type isEqualToString:@"disk"] && sharedEmulator.isRunning) {
|
||||
if ([shortcutItem.type isEqualToString:@"disk"]) {
|
||||
NSString *fileName = (NSString*)shortcutItem.userInfo[@"disk"];
|
||||
NSString *filePath = [self.documentsPath stringByAppendingPathComponent:fileName];
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath] && ![sharedEmulator isDiskInserted:filePath]) {
|
||||
|
|
|
@ -42,4 +42,8 @@ class DefaultSceneDelegate: UIResponder, UIWindowSceneDelegate {
|
|||
func sceneDidBecomeActive(_ scene: UIScene) {
|
||||
AppDelegate.emulator.isRunning = true
|
||||
}
|
||||
|
||||
func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
|
||||
AppDelegate.shared.application(UIApplication.shared, performActionFor: shortcutItem, completionHandler: completionHandler)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user