Commit c28b88e4 authored by Soomin Lee's avatar Soomin Lee

AppDelegate: Move setupBlock to a method

parent a18987ed
...@@ -82,6 +82,19 @@ ...@@ -82,6 +82,19 @@
[defaults registerDefaults:appDefaults]; [defaults registerDefaults:appDefaults];
} }
- (void)setup
{
void (^setupLibraryBlock)(void) = ^{
self->appCoordinator = [[AppCoordinator alloc] initWithViewController:self->rootViewController];
[self->appCoordinator start];
};
[self validatePasscodeIfNeededWithCompletion:setupLibraryBlock];
BOOL spotlightEnabled = ![VLCKeychainCoordinator passcodeLockEnabled];
[[MLMediaLibrary sharedMediaLibrary] setSpotlightIndexingEnabled:spotlightEnabled];
[[MLMediaLibrary sharedMediaLibrary] applicationWillStart];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{ {
BITHockeyManager *hockeyManager = [BITHockeyManager sharedHockeyManager]; BITHockeyManager *hockeyManager = [BITHockeyManager sharedHockeyManager];
...@@ -99,19 +112,7 @@ ...@@ -99,19 +112,7 @@
rootViewController = [UIViewController new]; rootViewController = [UIViewController new];
self.window.rootViewController = rootViewController; self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
// enable crash preventer [self setup];
void (^setupBlock)(void) = ^{
void (^setupLibraryBlock)(void) = ^{
self->appCoordinator = [[AppCoordinator alloc] initWithViewController:self->rootViewController];
[self->appCoordinator start];
};
[self validatePasscodeIfNeededWithCompletion:setupLibraryBlock];
BOOL spotlightEnabled = ![VLCKeychainCoordinator passcodeLockEnabled];
[[MLMediaLibrary sharedMediaLibrary] setSpotlightIndexingEnabled:spotlightEnabled];
[[MLMediaLibrary sharedMediaLibrary] applicationWillStart];
};
setupBlock();
/* add our static shortcut items the dynamic way to ease l10n and dynamic elements to be introduced later */ /* add our static shortcut items the dynamic way to ease l10n and dynamic elements to be introduced later */
if (@available(iOS 9, *)) { if (@available(iOS 9, *)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment