12345678910111213141516171819202122232425262728293031323334 |
- import Foundation
- public extension UIViewController {
-
- func popToRootController() {
- navigationController?.popToRootViewController(animated: true)
- }
-
- func pushController(_ vc: UIViewController, animted: Bool = true) {
- navigationController?.pushViewController(vc, animated: animted)
- }
-
- 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)
- }
- }
|