|
//
// UIViewController+NavigationBack.swift
// PaiaiUIKit
//
// Created by ffib on 2019/1/15.
// Copyright © 2019 yb. All rights reserved.
//
import Foundation
public extension UIViewController {
func pushViewController<T: UIViewController & NavigationBackViewController>(_ vc: T, animted: Bool = true) {
vc.setupNavigationBackItem()
navigationController?.pushViewController(vc, animated: animted)
vc.navigationController?.interactivePopGestureRecognizer?.setDelegate(vc)
vc.navigationController?.interactivePopGestureRecognizer?.isEnabled = true
}
@objc func backToViewController() {
popController(animated: true)
}
}
|