//
//  UINavigationController+.swift
//  YTBase_Example
//
//  Created by YouT on 2020/9/16.
//  Copyright © 2020 CocoaPods. All rights reserved.
//

import UIKit

public extension UINavigationController {
    func popTwoStep() {
        let subViewC = viewControllers
        switch subViewC.count {
        case 0:
            return
        case 1,2:
            popToRootViewController(animated: true)
        default:
            popToViewController(subViewC[subViewC.count-3], animated: true)
        }
    }
}
