Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fluxo de Login #1

Open
ltsuda opened this issue Jul 14, 2016 · 1 comment
Open

Fluxo de Login #1

ltsuda opened this issue Jul 14, 2016 · 1 comment

Comments

@ltsuda
Copy link
Owner

ltsuda commented Jul 14, 2016

@chrisfsampaio

Estou tentando fazer o fluxo de login, exemplo:

  • Se usuário não está logado, vai pro PresentViewController (tela principal)
  • Se usuário já está logado, vai pro MapViewController (que possui botão logout)

Problemas:

  • Quando eu vou direto pro MapViewController, não tenho a hierarquia PresentVC -> LoginVC -> MapVC até ai tudo bem.
  • Quando eu inicio na PresentViewController, vou pra LoginVC e MapVC; se eu fizer Logout, instanciando PresentViewController e novamente ir Login->Map, no debugger aparece 2 instancias da PresentVC/LoginVC porque na hora do logout elas ficaram na memória.
  • Testei com código abaixo e outras formas no AppDelegate mas sem sucesso, sempre fica umas instancias na memória.

let storyboard = UIStoryboard(name: "Main", bundle: nil) let initialViewController = storyboard.instantiateViewController(withIdentifier: "UINavigationControllerMain") present(initialViewController, animated: true, completion: nil) // UIApplication.shared().delegate?.window??.rootViewController = initialViewController

Poderia ajudar? Vou continuando outras coisas.

Thanks 👍

@ltsuda
Copy link
Owner Author

ltsuda commented Jul 20, 2016

Adicionei o listener do Firebase que verifica se o usuário está logado ou não, se estiver ele vai pra MapViewController.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant