added files via upload

This commit is contained in:
Balackburn
2023-06-27 09:54:41 +02:00
commit 2ff6aac218
1420 changed files with 88898 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
//
// FLEXViewControllerShortcuts.m
// FLEX
//
// Created by Tanner Bennett on 12/12/19.
// Copyright © 2020 FLEX Team. All rights reserved.
//
#import "FLEXViewControllerShortcuts.h"
#import "FLEXObjectExplorerFactory.h"
#import "FLEXRuntimeUtility.h"
#import "FLEXShortcut.h"
#import "FLEXAlert.h"
@interface FLEXViewControllerShortcuts ()
@end
@implementation FLEXViewControllerShortcuts
#pragma mark - Overrides
+ (instancetype)forObject:(UIViewController *)viewController {
BOOL (^vcIsInuse)(UIViewController *) = ^BOOL(UIViewController *controller) {
if (controller.viewIfLoaded.window) {
return YES;
}
return controller.navigationController != nil;
};
return [self forObject:viewController additionalRows:@[
[FLEXActionShortcut title:@"Push View Controller"
subtitle:^NSString *(UIViewController *controller) {
return vcIsInuse(controller) ? @"In use, cannot push" : nil;
}
selectionHandler:^void(UIViewController *host, UIViewController *controller) {
if (!vcIsInuse(controller)) {
[host.navigationController pushViewController:controller animated:YES];
} else {
[FLEXAlert
showAlert:@"Cannot Push View Controller"
message:@"This view controller's view is currently in use."
from:host
];
}
}
accessoryType:^UITableViewCellAccessoryType(UIViewController *controller) {
if (!vcIsInuse(controller)) {
return UITableViewCellAccessoryDisclosureIndicator;
} else {
return UITableViewCellAccessoryNone;
}
}
]
]];
}
@end