No Description

UIViewController+Navigation.swift 910B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // UIViewController+Navigation.swift
  3. // PaiaiUIKit
  4. //
  5. // Created by ffib on 2019/1/15.
  6. // Copyright © 2019 yb. All rights reserved.
  7. //
  8. import Foundation
  9. /// MARK: extension
  10. public extension UIViewController {
  11. func popToRootController() {
  12. navigationController?.popToRootViewController(animated: true)
  13. }
  14. func pushController(_ vc: UIViewController, animted: Bool = true) {
  15. navigationController?.pushViewController(vc, animated: animted)
  16. }
  17. func popToController(_ vc: UIViewController, animated: Bool = true) {
  18. navigationController?.popToViewController(vc, animated: animated)
  19. }
  20. func presentController(_ vc: UIViewController, animated: Bool = true) {
  21. present(vc, animated: animated, completion: nil)
  22. }
  23. func dismissController(animated: Bool = true) {
  24. dismiss(animated: animated, completion: nil)
  25. }
  26. }