diff --git a/Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.swift b/Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.swift index 2df14e8e2..e072ff350 100644 --- a/Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.swift +++ b/Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.swift @@ -28,6 +28,8 @@ class DirectoryRoomTableViewCell: UITableViewCell { avatarImageView.layer.cornerRadius = avatarImageView.frame.width/2 } } + + @IBOutlet private weak var numberOfUsersIcon: UIImageView! @IBOutlet private weak var displaynameLabel: UILabel! @IBOutlet private weak var numberOfUsersLabel: UILabel! @IBOutlet private weak var topicLabel: UILabel! @@ -51,12 +53,11 @@ class DirectoryRoomTableViewCell: UITableViewCell { displaynameLabel.text = viewModel.title - if viewModel.numberOfUsers > 0 { - numberOfUsersLabel.isHidden = false - numberOfUsersLabel.text = String(viewModel.numberOfUsers) - } else { - numberOfUsersLabel.isHidden = true - } + let canShowNumberOfUsers = viewModel.numberOfUsers > 0 + + numberOfUsersLabel.text = canShowNumberOfUsers ? String(viewModel.numberOfUsers) : nil + numberOfUsersLabel.isHidden = !canShowNumberOfUsers + numberOfUsersIcon.isHidden = !canShowNumberOfUsers if let subtitle = viewModel.subtitle { topicLabel.text = subtitle diff --git a/Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.xib b/Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.xib index 73eac9e1b..d4bd7b23c 100644 --- a/Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.xib +++ b/Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.xib @@ -1,10 +1,11 @@ - + - + + @@ -22,7 +23,7 @@ - + @@ -84,9 +85,9 @@ -