Skip to content

Commit

Permalink
Merge pull request #117 from bldsky/feature/number-of-participants-re…
Browse files Browse the repository at this point in the history
…striction

参加人数の制限について
  • Loading branch information
tsuu32 authored Jan 7, 2020
2 parents 2bd9a82 + a7c749e commit fa43116
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions DJYusaku/ListenerConnectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ extension ListenerConnectionViewController: UITableViewDataSource {
cell.numberOfParticipants?.text = "\(numberOfParticipants)/8"
if numberOfParticipants == 8 {
cell.numberOfParticipantsBackgroundView.layer.backgroundColor = CGColor(srgbRed: 1.0, green: 0.0, blue: 0.0, alpha: 1.0)
cell.djImageView.alpha = 0.3
cell.djName.alpha = 0.3
cell.selectionStyle = .none
}
}
DispatchQueue.global().async {
Expand All @@ -70,9 +73,11 @@ extension ListenerConnectionViewController: UITableViewDataSource {

extension ListenerConnectionViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let selectedDJ = ConnectionController.shared.connectableDJs[indexPath.row]
ConnectionController.shared.startListener(selectedDJ: selectedDJ)
self.dismiss(animated: true)
if ConnectionController.shared.numberOfParticipantsCorrespondence[ConnectionController.shared.connectableDJs[indexPath.row]] != 8 {
let selectedDJ = ConnectionController.shared.connectableDJs[indexPath.row]
ConnectionController.shared.startListener(selectedDJ: selectedDJ)
self.dismiss(animated: true)
}
}
}

Expand Down

0 comments on commit fa43116

Please sign in to comment.