Skip to content

Instantly share code, notes, and snippets.

@AmrAbedal
Created May 5, 2021 09:47
Show Gist options
  • Save AmrAbedal/1bd20b5b679a126bfb666307acbe4e56 to your computer and use it in GitHub Desktop.
Save AmrAbedal/1bd20b5b679a126bfb666307acbe4e56 to your computer and use it in GitHub Desktop.
class CreatePostCardCoordinator {
private let presentingViewController: UIViewController
lazy var tabBarController: UITabBarController = {
let viewModel = CreatePostCardViewModel.init(coordinator: self)
let tabBarController = CreatePostCardTabBarViewController.init(viewModel: viewModel)
return tabBarController
}()
init(presentingViewController: UIViewController) {
self.presentingViewController = presentingViewController
}
func start() {
self.presentingViewController.present(tabBarController, animated: true, completion: nil)
}
func setupTapBar(delegate: CreatePostCardDelegate) {
PostCardStyleCoordinator.init(tabBarController: tabBarController, delegate: delegate).start()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment