Adds temporary semaphore to ensure DatabaseManager finishes before showing UI

This commit is contained in:
Riley Testut 2016-05-21 01:04:32 -05:00
parent 9dcb88b2de
commit c08e2a2de7

View File

@ -20,9 +20,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate
self.window?.tintColor = UIColor.deltaPurpleColor()
// Database
let semaphore = dispatch_semaphore_create(0)
DatabaseManager.sharedManager.startWithCompletion { performingMigration in
dispatch_semaphore_signal(semaphore)
}
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER)
// Controllers
ExternalControllerManager.sharedManager.startMonitoringExternalControllers()