Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/9 #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions chat-iOS/Views/MainTabBar/MainTabBarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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, *) {
Expand All @@ -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) {
Expand Down
11 changes: 10 additions & 1 deletion chat-iOS/Views/SelectChat/SelectChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,23 @@ 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 {
let cell = tableView.dequeueReusableCell(withIdentifier: reuseCellId) as! SelectChatTableViewCell

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)
ojun9 marked this conversation as resolved.
Show resolved Hide resolved
}

}

Expand Down