home } private var currentViewController: UIViewController? func switchState(to state: State) { if let cvc = currentViewController { cvc.willMove(toParentViewController: nil) cvc.view.removeFromSuperview() cvc.removeFromParentViewController() } switch state { case .splash: currentViewController = SplashViewController() case .home: currentViewController = homeNavigationViewController } addChildViewController(currentViewController!) view.addSubview(currentViewController!.view) currentViewController!.didMove(toParentViewController: self) } let homeNavigationViewController = UINavigationController(rootViewController: HomeViewController()) } υϦϧμϯͷ֊Λҡ͍࣋ͨ͠ 7JFX$POUSPMMFS εΠονͰഁغ͞Εͳ͍Α͏ʹ͢Δ