Skip to content

Commit

Permalink
chnage navigationModelDelegate
Browse files Browse the repository at this point in the history
  • Loading branch information
tzopiz committed Jul 5, 2024
1 parent 279c6e5 commit f0c7fac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,22 @@ extension BaseViewController {

// MARK: - ViewModelNavigationDelegate
extension BaseViewController: ViewModelNavigationDelegate {
public func pushViewController(_ viewController: UIViewController, animated: Bool) {
public func pushController(
_ viewController: UIViewController,
animated: Bool
) {
guard let navigationController = navigationController else { return }
navigationController.pushViewController(viewController, animated: animated)
}
public func dismiss(animated: Bool) {
public func dismissController(animated: Bool, completion: (() -> Void)? = nil) {
guard let navigationController = navigationController else { return }
navigationController.dismiss(animated: animated, completion: nil)
navigationController.dismiss(animated: animated, completion: completion)
}
public func presentViewController(_ viewController: UIViewController, animated: Bool) {
present(viewController, animated: animated)
public func presentController(
_ viewController: UIViewController,
animated: Bool,
completion: (() -> Void)? = nil
) {
present(viewController, animated: animated, completion: completion)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import UIKit

public protocol ViewModelNavigationDelegate: AnyObject {
func presentViewController(_ viewController: UIViewController, animated: Bool)
func pushViewController(_ viewController: UIViewController, animated: Bool)
func dismiss(animated: Bool)
func presentController(_ viewController: UIViewController, animated: Bool, completion: (() -> Void)?)
func pushController(_ viewController: UIViewController, animated: Bool)
func dismissController(animated: Bool, completion: (() -> Void)?)
}

0 comments on commit f0c7fac

Please sign in to comment.