Open clankbear opened 5 years ago
hi, I am wondering why need use Constants.UserDefaults.currentUser when we have Auth.auth().currentUser? thanks.
if let _ = Auth.auth().currentUser, let userData = defaults.object(forKey: Constants.UserDefaults.currentUser) as? Data, let user = try? JSONDecoder().decode(User.self, from: userData) { User.setCurrent(user) initialViewController = UIStoryboard.initialViewController(for: .main) } else { initialViewController = UIStoryboard.initialViewController(for: .login) }
hi, I am wondering why need use Constants.UserDefaults.currentUser when we have Auth.auth().currentUser? thanks.