|
|
@@ -12,7 +12,7 @@
|
|
|
#endif
|
|
|
|
|
|
@interface AAPLCatalogTableTableViewController ()
|
|
|
-
|
|
|
+- (void)registerViewControllerBasedOption;
|
|
|
@end
|
|
|
|
|
|
@implementation AAPLCatalogTableTableViewController
|
|
|
@@ -22,6 +22,7 @@
|
|
|
[super viewDidLoad];
|
|
|
|
|
|
#if DEBUG
|
|
|
+ [self registerViewControllerBasedOption];
|
|
|
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"FLEX" style:UIBarButtonItemStylePlain target:self action:@selector(flexButtonTapped:)];
|
|
|
#endif
|
|
|
}
|
|
|
@@ -34,4 +35,40 @@
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
+- (void)registerViewControllerBasedOption
|
|
|
+{
|
|
|
+ // create UIViewController subclass
|
|
|
+ UIViewController *viewController = [[UIViewController alloc] init];
|
|
|
+
|
|
|
+ // fill it with some stuff
|
|
|
+ UILabel *infoLabel = [[UILabel alloc] init];
|
|
|
+ infoLabel.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
+ infoLabel.text = @"Add switches, notes or whatewer you wish to provide your testers with superpowers!";
|
|
|
+ infoLabel.numberOfLines = 0;
|
|
|
+ infoLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
+
|
|
|
+ UIView *view = viewController.view;
|
|
|
+ view.backgroundColor = [UIColor whiteColor];
|
|
|
+ [view addSubview:infoLabel];
|
|
|
+
|
|
|
+ [view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[infoLabel]-0-|"
|
|
|
+ options:0
|
|
|
+ metrics:nil
|
|
|
+ views:NSDictionaryOfVariableBindings(infoLabel)]];
|
|
|
+
|
|
|
+ [view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[infoLabel]-0-|"
|
|
|
+ options:0
|
|
|
+ metrics:nil
|
|
|
+ views:NSDictionaryOfVariableBindings(infoLabel)]];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // return it in objectFutureBlock
|
|
|
+ [[FLEXManager sharedManager] registerGlobalEntryWithName:@"Custom superpowers"
|
|
|
+ objectFutureBlock:^id{
|
|
|
+ return viewController;
|
|
|
+ }
|
|
|
+ forceObjectExplorer:NO];
|
|
|
+}
|
|
|
+
|
|
|
@end
|