From 259fbc2a49daba9037910e23def6c27cb1572ba9 Mon Sep 17 00:00:00 2001 From: TappediOS Date: Tue, 30 Jun 2020 15:24:53 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E3=83=81=E3=83=A3=E3=83=83=E3=83=88?= =?UTF-8?q?=E3=82=BB=E3=83=AC=E3=82=AF=E3=83=88=E7=94=BB=E9=9D=A2=E3=81=AB?= =?UTF-8?q?=E9=81=B7=E7=A7=BB=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chat-iOS/Views/MainTabBar/MainTabBarViewController.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/chat-iOS/Views/MainTabBar/MainTabBarViewController.swift b/chat-iOS/Views/MainTabBar/MainTabBarViewController.swift index ad3a78c..64b5b3e 100644 --- a/chat-iOS/Views/MainTabBar/MainTabBarViewController.swift +++ b/chat-iOS/Views/MainTabBar/MainTabBarViewController.swift @@ -22,9 +22,8 @@ final class MainTabBarViewController: UITabBarController { let userProfileVC = UserProfileViewBuilder.create() let userProfileNavigationController = UINavigationController(rootViewController: userProfileVC) - //TODO:- ここはチャットセレクト画面に遷移すること - let chatsVC = ChatsViewBuilder.create() - let chatsNavigationController = UINavigationController(rootViewController: chatsVC) + let selectChatVC = SelectChatViewBuilder.create() + let selectChatNavigationController = UINavigationController(rootViewController: selectChatVC) //TODO:- iOS12以下の場合の画像を用意すること if #available(iOS 13.0, *) { @@ -35,12 +34,12 @@ final class MainTabBarViewController: UITabBarController { let userProfileTabBarItemSelectedImage = UIImage(systemName: "person.circle.fill") userProfileVC.tabBarItem = UITabBarItem(title: nil, image: userProfileTabBarItemImage, selectedImage: userProfileTabBarItemSelectedImage) - chatsVC.tabBarItem = UITabBarItem(title: nil, image: chatsTabBarItemImage, selectedImage: chatsTabBarItemSelectedImage) + selectChatVC.tabBarItem = UITabBarItem(title: nil, image: chatsTabBarItemImage, selectedImage: chatsTabBarItemSelectedImage) } else { // Fallback on earlier versions } - self.viewControllers = [chatsNavigationController, userProfileNavigationController] + self.viewControllers = [selectChatNavigationController, userProfileNavigationController] } func inject(with presenter: MainTabBarViewPresenterProtocol) { From 348410b1c83150dd37dc5db577fcf81183268a34 Mon Sep 17 00:00:00 2001 From: TappediOS Date: Tue, 30 Jun 2020 16:13:56 +0900 Subject: [PATCH 2/2] =?UTF-8?q?cell=E3=82=92=E3=82=BF=E3=83=83=E3=83=95?= =?UTF-8?q?=E3=82=9A=E3=81=97=E3=81=9F=E3=81=A8=E3=81=8D=E3=81=AE=E7=94=BB?= =?UTF-8?q?=E9=9D=A2=E9=81=B7=E7=A7=BB=E5=87=A6=E7=90=86=E3=82=92=E6=9B=B8?= =?UTF-8?q?=E3=81=84=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/SelectChat/SelectChatViewController.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/chat-iOS/Views/SelectChat/SelectChatViewController.swift b/chat-iOS/Views/SelectChat/SelectChatViewController.swift index 6ba3297..4418991 100644 --- a/chat-iOS/Views/SelectChat/SelectChatViewController.swift +++ b/chat-iOS/Views/SelectChat/SelectChatViewController.swift @@ -41,7 +41,8 @@ final class SelectChatViewController: UIViewController { extension SelectChatViewController: UITableViewDelegate, UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return users.count + //TODO:- userModelを作ったら,`return users.count` に修正すること + return 5 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { @@ -49,6 +50,14 @@ extension SelectChatViewController: UITableViewDelegate, UITableViewDataSource { return cell } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + self.tableView.deselectRow(at: indexPath, animated: true) + + //MARK:- チャットVCに画面遷移する + let chatsVC = ChatsViewBuilder.create() + self.navigationController?.pushViewController(chatsVC, animated: true) + } }