title: Number cells for UITableView
body: <p>I am trying number cell from 0-X for a uitableview. Currently I am using a label to do it and I just want the labels text to be 0,1,2,3,4,...X.</p>
  
  <pre><code>//label for the cell
      let cellFrame: CGRect = CGRectMake(0, 0, 90, 32)
      var cellLabel = UILabel(frame: cellFrame)
      cellLabel.textAlignment = .Center
      cellLabel.font = UIFont.MDFont.regularFourteen
      cellLabel.text = ("\(indexPath.row)")
  </code></pre>
  
  <p>I have tried this approach and it just does 0,1,2,3,4 but when I scroll it prints 0,1,2,3,4 on top of the other numbers as well. </p>
  
  <p>This is the whole code for the function</p>
  
  <pre><code> func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
      var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier("cell") as! UITableViewCell
  
      if cell == null {
          //label for the cell
          let cellFrame: CGRect = CGRectMake(0, 0, 90, 32)
          var cellLabel = UILabel(frame: cellFrame)
          cellLabel.textAlignment = .Center
          cellLabel.font = UIFont.MDFont.regularFourteen
          cellLabel.text = ("\(indexPath.row)")
          cell.contentView.addSubview(cellLabel)
      }
  
  
      //print("Table data is \(tableData[5])")
      return cell
  }
  </code></pre>