|
@@ -131,7 +131,9 @@ class ChatViewCoordinator: Coordinator {
|
|
|
|
|
|
func showChatDetail(chatId: Int) {
|
|
|
let chatDetailViewController = ChatDetailViewController(chatId: chatId)
|
|
|
- // TODO: create + add chatDetailCoordinator
|
|
|
+ let coordinator = ChatDetailCoordinator(navigationController: self.navigationController)
|
|
|
+ childCoordinators.append(coordinator)
|
|
|
+ chatDetailViewController.coordinator = coordinator
|
|
|
navigationController.pushViewController(chatDetailViewController, animated: true)
|
|
|
}
|
|
|
}
|
|
@@ -236,4 +238,16 @@ class NewChatCoordinator: Coordinator {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+class ChatDetailCoordinator: Coordinator {
|
|
|
+ var rootViewController: UIViewController
|
|
|
+ let navigationController: UINavigationController
|
|
|
+
|
|
|
+ private var childCoordinators:[Coordinator] = []
|
|
|
+
|
|
|
+ init(navigationController: UINavigationController) {
|
|
|
+ self.rootViewController = navigationController.viewControllers.first!
|
|
|
+ self.navigationController = navigationController
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
|