mirror of
https://github.com/samsonjs/samhuri.net-ios.git
synced 2026-03-25 09:25:47 +00:00
enable code injection
This commit is contained in:
parent
3a8e3b70eb
commit
2f92db3d73
2 changed files with 18 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
|||
// Copyright (c) 2014 Guru Logic Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import <dyci/SFDynamicCodeInjection.h>
|
||||
#import "AppDelegate.h"
|
||||
#import "PostsViewController.h"
|
||||
#import "EditorViewController.h"
|
||||
|
|
@ -23,6 +24,7 @@
|
|||
@implementation AppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
[self configureCodeInjection];
|
||||
UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
|
||||
UINavigationController *navigationController = splitViewController.viewControllers.lastObject;
|
||||
navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem;
|
||||
|
|
@ -31,6 +33,18 @@
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (void)configureCodeInjection {
|
||||
__block BOOL codeInjectionEnabled = NO;
|
||||
[[[NSProcessInfo processInfo] arguments] enumerateObjectsUsingBlock:^(NSString *obj, NSUInteger idx, BOOL *stop) {
|
||||
if ([obj isEqual:@"EnableCodeInjection"]) {
|
||||
codeInjectionEnabled = YES;
|
||||
}
|
||||
}];
|
||||
if (!codeInjectionEnabled) {
|
||||
[NSClassFromString(@"SFDynamicCodeInjection") performSelector:@selector(disable)];
|
||||
}
|
||||
}
|
||||
|
||||
- (PostsViewController *)postsViewController {
|
||||
UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
|
||||
UINavigationController *navigationController = splitViewController.viewControllers.firstObject;
|
||||
|
|
|
|||
|
|
@ -84,6 +84,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)updateOnClassInjection {
|
||||
[self configureView];
|
||||
}
|
||||
|
||||
- (void)configureView {
|
||||
[self configureTitleView];
|
||||
[self configureLinkView];
|
||||
|
|
|
|||
Loading…
Reference in a new issue