2017-12-21 4 views
0

내 앱의 첫 번째 부분은 내비게이션 컨트롤러가 내장 된 로그인 섹션입니다. 가입 섹션이 완료되고 새 사용자가 생성되면 UITabBarController를 진행하고 각 탭에 별도의 탐색 컨트롤러를 추가합니다. 지금 가입이 완료되고 내 UITabBarController가 표시되면 내 앱의 첫 번째 섹션에서 UINavigationController가 표시됩니다. 새 UITabBarController를 입력하면 어떻게 UINavigationController를 종료합니까? 여기 UINabigationController to UITabBarController

enter image description here

그리고

enter image description here

메인 TabBar의 컨트롤러가되면 일반적으로 가입이 필요 없다 당신은 더 나은

self.navigationController?.present(vc, animated: true, completion: nil) 

를 사용해야하는 코드

import UIKit 

class SignUpSecondViewController: UIViewController, BEMCheckBoxDelegate { 

@IBAction func completeButtonAction(_ sender: Any) { 

    let storyboard = UIStoryboard(name: "Main", bundle: nil) 
    let vc = storyboard.instantiateViewController(withIdentifier: "NewTabBarViewController") as! UIViewController 
    // Alternative way to present the new view controller 
    self.navigationController?.show(vc, sender: nil) 
} 

답변

1

입니다 . 이 경우 메모리에서 가입을 제거 할 수 있습니다.

let appDelegate = UIApplication.shared.delegate as! AppDelegate) 
appDelegate.window?.rootViewController = vc