1234567891011121314151617181920212223 |
- 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)
- }
- }
|