title: Custom Cell contents in UICollectionView
body: <p>I'm trying to add a UICollectionView in a swift class programmatically, without any storyboard, with a custom cell (a simple label in every cell)</p>
  
  <pre><code>import Foundation
  import UIKit
  
  class BoardView : UIView, UICollectionViewDataSource, UICollectionViewDelegate {
  
      var boardTable: UICollectionView!
      var cellLabel:UILabel!
      let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout()
  
      var items = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
  
      convenience init(frame: CGRect, title: String) {
          self.init(frame: frame)
      }
  
      override init(frame: CGRect) {
          super.init(frame: frame)
          layout.sectionInset = UIEdgeInsets(top: 60, left: 10, bottom: 10, right: 10)
          layout.itemSize = CGSize(width: 30, height: 30)
          boardTable = UICollectionView(frame: self.frame, collectionViewLayout: layout)
          boardTable.dataSource = self
          boardTable.delegate = self
          boardTable.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "cell")
          boardTable.backgroundColor = UIColor.clear
          self.addSubview(boardTable)
  
      }
  
      required init?(coder aDecoder: NSCoder) {
          fatalError("MainViewis not NSCoding compliant")
      }
  
      func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
          return self.items.count
      }
  
      func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
          let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath as IndexPath)
          cellLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 30, height: 30))
          cellLabel.textAlignment = .center
          cellLabel.text = self.items[indexPath.item]
          cell.contentView.addSubview(cellLabel)
          return cell
      }
  
      func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath)
      {
          print("User tapped on item \(indexPath.row)")
      }    
  }
  </code></pre>
  
  <p>I'm able to change the cell background with the code</p>
  
  <pre><code>let cell = self.boardTable.cellForItem(at: IndexPath(row: 1 , section: 0))
  cell?.backgroundColor = UIColor.lightGray
  </code></pre>
  
  <p>How I may change the cell text color or the cell text content (the cellLabel)?</p>
  
  <p>Thanks in advance for your support.</p>