Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save matiasvillaverde/bb7735b7a415109294ae6d81fd63a07d to your computer and use it in GitHub Desktop.
Save matiasvillaverde/bb7735b7a415109294ae6d81fd63a07d to your computer and use it in GitHub Desktop.
// MARK: - We use it to know when the microstrategy VC is created or to handle the error.
extension NavigationManager: MSTRVCRetrieverDelegate {
/**
This method is called when the VCRetriever encountered an Error while fetching the VC
*/
func retriever(retriever: MSTRVCRetriever!, didFailWithError error: MSTRError!) {
//ERROR is always nil. We should be able to know if the password is not correct, or why the user can't access.
// Close the Waiting.
Async.main {
Navigation.loadingAlert?.close()
Navigation.NavigationController.visibleViewController?.showError("Error 😖".localized(), subtitle: error.localizedDescription) //This is going to crash because error is always nil.
}
}
/**
This method is called when the VCRetriever has fetched a VC
*/
func retriever(retriever: MSTRVCRetriever!, didFetchVC viewController: UIViewController!) {
// Close the Waiting.
Async.main {
Navigation.loadingAlert?.close()
Navigation.NavigationController.pushViewController(viewController, animated: true)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment