|
@@ -12,6 +12,7 @@
|
|
|
#import "FLEXGlobalsTableViewControllerEntry.h"
|
|
#import "FLEXGlobalsTableViewControllerEntry.h"
|
|
|
#import "FLEXObjectExplorerFactory.h"
|
|
#import "FLEXObjectExplorerFactory.h"
|
|
|
#import "FLEXObjectExplorerViewController.h"
|
|
#import "FLEXObjectExplorerViewController.h"
|
|
|
|
|
+#import <objc/runtime.h>
|
|
|
|
|
|
|
|
@interface FLEXManager () <FLEXWindowEventDelegate, FLEXExplorerViewControllerDelegate>
|
|
@interface FLEXManager () <FLEXWindowEventDelegate, FLEXExplorerViewControllerDelegate>
|
|
|
|
|
|
|
@@ -102,6 +103,13 @@
|
|
|
#pragma mark - Extensions
|
|
#pragma mark - Extensions
|
|
|
|
|
|
|
|
- (void)registerGlobalEntryWithName:(NSString *)entryName objectFutureBlock:(id (^)(void))objectFutureBlock
|
|
- (void)registerGlobalEntryWithName:(NSString *)entryName objectFutureBlock:(id (^)(void))objectFutureBlock
|
|
|
|
|
+{
|
|
|
|
|
+ [self registerGlobalEntryWithName:entryName objectFutureBlock:objectFutureBlock forceObjectExplorer:YES];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+- (void)registerGlobalEntryWithName:(NSString *)entryName
|
|
|
|
|
+ objectFutureBlock:(id (^)(void))objectFutureBlock
|
|
|
|
|
+ forceObjectExplorer:(BOOL)forceObjectExplorer
|
|
|
{
|
|
{
|
|
|
NSParameterAssert(entryName);
|
|
NSParameterAssert(entryName);
|
|
|
NSParameterAssert(objectFutureBlock);
|
|
NSParameterAssert(objectFutureBlock);
|
|
@@ -111,7 +119,16 @@
|
|
|
FLEXGlobalsTableViewControllerEntry *entry = [FLEXGlobalsTableViewControllerEntry entryWithNameFuture:^NSString *{
|
|
FLEXGlobalsTableViewControllerEntry *entry = [FLEXGlobalsTableViewControllerEntry entryWithNameFuture:^NSString *{
|
|
|
return entryName;
|
|
return entryName;
|
|
|
} viewControllerFuture:^UIViewController *{
|
|
} viewControllerFuture:^UIViewController *{
|
|
|
- return [FLEXObjectExplorerFactory explorerViewControllerForObject:objectFutureBlock()];
|
|
|
|
|
|
|
+ id object = objectFutureBlock();
|
|
|
|
|
+
|
|
|
|
|
+ if([object_getClass(object) isSubclassOfClass:[UIViewController class]] && forceObjectExplorer == NO)
|
|
|
|
|
+ {
|
|
|
|
|
+ return object;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ return [FLEXObjectExplorerFactory explorerViewControllerForObject:object];
|
|
|
|
|
+ }
|
|
|
}];
|
|
}];
|
|
|
|
|
|
|
|
[self.userGlobalEntries addObject:entry];
|
|
[self.userGlobalEntries addObject:entry];
|