func setCell()

in tutorials/tutorial2/TicTacToe/TicTacToe/TicTacToeViewController.swift [47:59]


    func setCell(atRow row: Int, col: Int, withPlayerType playerType: PlayerType) {
        let indexPathRow = row * GameConstants.colCount + col
        let color: UIColor = {
            switch playerType {
            case .red:
                return UIColor.red
            case .blue:
                return UIColor.blue
            }
        }()
        let cell = collectionView.cellForItem(at: IndexPath(row: indexPathRow, section: Constants.sectionCount - 1))
        cell?.backgroundColor = color
    }