|
|
|
@ -45,18 +45,4 @@ extension UIViewController { |
|
|
|
|
func hideLoading(animated: Bool = true) { |
|
|
|
|
MBProgressHUD.hide(for: view, animated: animated) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func add(asChildViewController viewController: UIViewController) { |
|
|
|
|
addChildViewController(viewController) |
|
|
|
|
view.addSubview(viewController.view) |
|
|
|
|
viewController.view.frame = view.bounds |
|
|
|
|
viewController.view.autoresizingMask = [.flexibleWidth, .flexibleHeight] |
|
|
|
|
viewController.didMove(toParentViewController: self) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func remove(asChildViewController viewController: UIViewController) { |
|
|
|
|
viewController.willMove(toParentViewController: nil) |
|
|
|
|
viewController.view.removeFromSuperview() |
|
|
|
|
viewController.removeFromParentViewController() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|