Brak opisu

UIViewController+Navigation.swift 1.0KB

    // // UIViewController+Navigation.swift // PaiaiUIKit // // Created by ffib on 2019/1/15. // Copyright © 2019 yb. All rights reserved. // import Foundation /// MARK: extension public extension UIViewController { func popToRootController() { navigationController?.popToRootViewController(animated: true) } func pushController(_ vc: UIViewController, animted: Bool = true) { navigationController?.pushViewController(vc, animated: animted) } // @objc func popViewController(animated: Bool = true) { // navigationController?.popViewController(animated: animated) // } func popToController(_ vc: UIViewController, animated: Bool = true) { navigationController?.popToViewController(vc, animated: animated) } func presentController(_ vc: UIViewController, animated: Bool = true) { present(vc, animated: animated, completion: nil) } func dismissController(animated: Bool = true) { dismiss(animated: animated, completion: nil) } }