Adds temporary semaphore to ensure DatabaseManager finishes before showing UI
This commit is contained in:
parent
9dcb88b2de
commit
c08e2a2de7
@ -20,9 +20,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate
|
|||||||
self.window?.tintColor = UIColor.deltaPurpleColor()
|
self.window?.tintColor = UIColor.deltaPurpleColor()
|
||||||
|
|
||||||
// Database
|
// Database
|
||||||
|
|
||||||
|
let semaphore = dispatch_semaphore_create(0)
|
||||||
|
|
||||||
DatabaseManager.sharedManager.startWithCompletion { performingMigration in
|
DatabaseManager.sharedManager.startWithCompletion { performingMigration in
|
||||||
|
dispatch_semaphore_signal(semaphore)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER)
|
||||||
|
|
||||||
// Controllers
|
// Controllers
|
||||||
ExternalControllerManager.sharedManager.startMonitoringExternalControllers()
|
ExternalControllerManager.sharedManager.startMonitoringExternalControllers()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user