Skip to content

Commit

Permalink
Fixed cached view controller bug. Forced the adding for view controll…
Browse files Browse the repository at this point in the history
…ers to happen on the main thread.
  • Loading branch information
theangelperalta committed Nov 4, 2016
1 parent a406a17 commit fb21e3c
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,18 @@ open class TGCameraNavigationController: UINavigationController {
let bundle = Bundle(for: TGCameraViewController.self)
let viewController: TGCameraViewController = TGCameraViewController(nibName: "TGCameraViewController", bundle: bundle)
viewController.delegate = delegate
self.viewControllers = [viewController]

DispatchQueue.main.async {
self.viewControllers = [viewController]
}
}

func setupDenied() {
let bundle = Bundle(for: TGCameraViewController.self)
let viewController: UIViewController = TGCameraAuthorizationViewController(nibName: "TGCameraAuthorizationViewController", bundle: bundle)
self.viewControllers = [viewController]
DispatchQueue.main.async {
self.viewControllers = [viewController]
}
}

func setupNotDeterminedWithDelegate(_ delegate: TGCameraDelegate)
Expand Down

0 comments on commit fb21e3c

Please sign in to comment.