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 {
|
- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler {
|
||||||
BOOL success = NO;
|
BOOL success = NO;
|
||||||
if ([shortcutItem.type isEqualToString:@"disk"] && sharedEmulator.isRunning) {
|
if ([shortcutItem.type isEqualToString:@"disk"]) {
|
||||||
NSString *fileName = (NSString*)shortcutItem.userInfo[@"disk"];
|
NSString *fileName = (NSString*)shortcutItem.userInfo[@"disk"];
|
||||||
NSString *filePath = [self.documentsPath stringByAppendingPathComponent:fileName];
|
NSString *filePath = [self.documentsPath stringByAppendingPathComponent:fileName];
|
||||||
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath] && ![sharedEmulator isDiskInserted:filePath]) {
|
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath] && ![sharedEmulator isDiskInserted:filePath]) {
|
||||||
|
|
|
@ -42,4 +42,8 @@ class DefaultSceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||||
func sceneDidBecomeActive(_ scene: UIScene) {
|
func sceneDidBecomeActive(_ scene: UIScene) {
|
||||||
AppDelegate.emulator.isRunning = true
|
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