//
//  UINavigationController+NavigationBack.swift
//  PaiaiUIKit
//
//  Created by ffib on 2019/1/15.
//  Copyright © 2019 yb. All rights reserved.
//

import UIKit

public extension UINavigationController {
    func pushViewController<T: UIViewController & NavigationBackViewController>(_ vc: T, animted: Bool = true) {
        vc.setupNavigationBackItem()
        (vc as? NavigationBarPushAndPopDelegate)?.setupNavigationBarPushAndPopDelegate()
        pushViewController(vc, animated: animted)
        (vc as? NavigationBarInteractivePopDeletegate)?.setupNavigationBarInteractivePopDelegate()
    }
}