Skip to content

Commit

Permalink
[Fix/#62] Extension 사용으로 root이동 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-seonwoo committed Jan 12, 2024
1 parent 7c982c9 commit a151cd4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
4 changes: 3 additions & 1 deletion HMH_iOS/HMH_iOS/Application/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

let window = UIWindow(windowScene: windowScene)
self.window = window

let splashViewController = SplashViewController()
window.rootViewController = splashViewController
if let navigationController = window.rootViewController as? UINavigationController {
navigationController.isNavigationBarHidden = true
}
window.makeKeyAndVisible()

DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,9 @@ extension LoginViewController: ASAuthorizationControllerDelegate, ASAuthorizatio
print(UserManager.shared.getUserIdentifier)
print(UserManager.shared.getUserName)
if (UserManager.shared.appleUserIdentifier != nil) {
let nextViewController = TabBarController()
self.navigationController?.pushViewController(nextViewController, animated: true)
setRootViewController(TabBarController())
} else {
let nextViewController = TimeSurveyViewController()
self.navigationController?.pushViewController(nextViewController, animated: true)
setRootViewController(TimeSurveyViewController())
}

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,7 @@ final class SignInCompleteViewController: OnboardingBaseViewController {

extension SignInCompleteViewController: NextViewPushDelegate {
func didTapButton() {
let nextViewController = TabBarController()
let navigationController = UINavigationController(rootViewController: nextViewController)
let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate
guard let delegate = sceneDelegate else {
return
}
delegate.window?.rootViewController = navigationController
setRootViewController(TabBarController())
}
}

Expand Down

0 comments on commit a151cd4

Please sign in to comment.