瀏覽代碼

implemented showChatFunction in EditContactCoordinator

Bastian van de Wetering 6 年之前
父節點
當前提交
f7af6e9da2
共有 2 個文件被更改,包括 8 次插入4 次删除
  1. 0 1
      deltachat-ios/Controller/ChatViewController.swift
  2. 8 3
      deltachat-ios/Coordinator/AppCoordinator.swift

+ 0 - 1
deltachat-ios/Controller/ChatViewController.swift

@@ -45,7 +45,6 @@ class ChatViewController: MessagesViewController {
 		return messageInputBar
 		return messageInputBar
 	}
 	}
 
 
-
 	init(chatId: Int, title: String? = nil) {
 	init(chatId: Int, title: String? = nil) {
 		self.chatId = chatId
 		self.chatId = chatId
 		super.init(nibName: nil, bundle: nil)
 		super.init(nibName: nil, bundle: nil)

+ 8 - 3
deltachat-ios/Coordinator/AppCoordinator.swift

@@ -470,6 +470,8 @@ class EditContactCoordinator: Coordinator, EditContactCoordinatorProtocol {
 
 
 	let navigationController: UINavigationController
 	let navigationController: UINavigationController
 
 
+	var childCoordinators: [Coordinator] = []
+
 	init(navigationController: UINavigationController) {
 	init(navigationController: UINavigationController) {
 		self.navigationController = navigationController
 		self.navigationController = navigationController
 	}
 	}
@@ -479,10 +481,13 @@ class EditContactCoordinator: Coordinator, EditContactCoordinatorProtocol {
 	}
 	}
 
 
 	func showChat(chatId: Int) {
 	func showChat(chatId: Int) {
-
+		let chatViewController = ChatViewController(chatId: chatId)
+		let coordinator = ChatViewCoordinator(navigationController: navigationController)
+		childCoordinators.append(coordinator)
+		chatViewController.coordinator = coordinator
+		navigationController.popToRootViewController(animated: false)
+		navigationController.pushViewController(chatViewController, animated: true)
 	}
 	}
-
-
 }
 }
 
 
 protocol ContactDetailCoordinatorProtocol: class {
 protocol ContactDetailCoordinatorProtocol: class {