title: Multiple custom UITableView cells and sections
body: <p>I'm trying to create this look:</p>
  
  <p><a href="https://i.stack.imgur.com/rCUMf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rCUMf.png" alt="enter image description here"></a></p>
  
  <p>Right now I have this:</p>
  
  <p><a href="https://i.stack.imgur.com/1oYGL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1oYGL.png" alt="enter image description here"></a></p>
  
  <p>Three prototype cells with identifiers and custom cells respectively from top to bottom as</p>
  
  <p>ID</p>
  
  <ul>
  <li><p>cellStyle </p></li>
  <li><p>cellStyle2 </p></li>
  <li><p>cellStyle3</p></li>
  </ul>
  
  <p>with the custom cell classes merely having a capital C.</p>
  
  <p>This is my code so far:</p>
  
  <p><a href="https://i.stack.imgur.com/6NoKX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6NoKX.png" alt="enter image description here"></a></p>
  
  <p>What I'm trying to do is to change the dequeue cell to my different custom cell classes to be able to access their properties and change the labels and UIImageView.  This method is not working <code>cell.label.text</code> is not recognized.  I also tried creating three different variables for cell like so.</p>
  
  <pre><code>var cellStyle: CellStyle
  var cellStyle2: CellStyle2
  var cellStyle3: CellStyle3
  </code></pre>
  
  <p>What do I <code>return</code> for the function then?  </p>
  
  <p>Questions:</p>
  
  <ol>
  <li>Are either methods standard practice? If not, what is the standard code to accomplish what I'm trying to do?</li>
  <li>To get the cells to look like the top three buttons on my prototype do I need to inset?  I already have this in the runtime </li>
  </ol>
  
  <p><code>layer.borderColor
  layer.borderWidth
  layer.cornerRadius
  layer.masksToBounds</code></p>
  
  <ol start="3">
  <li>How do you configure <code>numberOfRowsInSection</code> for multiple sections?</li>
  </ol>
  
  <p>This is an update to my previous code based on comments.</p>
  
  <pre><code>override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
  
  
          switch indexPath.row {
  
          case 0:
  
              var cell = tableView.dequeueReusableCellWithIdentifier("cellStyle", forIndexPath: indexPath) as! cellStyle
  
              cell.label?.text = "Friends"
              // Configure cell
  
          case 1:
  
              var cell = tableView.dequeueReusableCellWithIdentifier("cellStyle2", forIndexPath: indexPath) as! cellStyle2
  
              // Configure cell
              cell.label?.text = "Random"
  
  
          case 2:
  
              var cell = tableView.dequeueReusableCellWithIdentifier("cellStyle", forIndexPath: indexPath) as! cellStyle
  
              // Configure cell
              cell.label?.text = "Judge"
  
  
          default:
              // Default cell with no text
  
              cell.textLabel?.text = ""
  
          }
  
          switch indexPath.section {
  
          case 0:
              var cell = tableView.dequeueReusableCellWithIdentifier("cellStyle3", forIndexPath: indexPath) as!  cellStyle3
  
              // Configure cell
  
              cell.label?.text = "" // TODO: Need to put name from opponent _User reference into here
  //             cell.friendProfilePic.image = //Query facebook api for profile picture of friend with Facebook ID for "opponent"
  
  
          case 1:
              var cell = tableView.dequeueReusableCellWithIdentifier("cellStyle3", forIndexPath: indexPath) as! cellStyle3
  
              // Configure cell
              cell.label?.text = "" // TODO: Need to put name from opponent _User reference into here
              //             cell.friendProfilePic.image = //Query facebook api for profile picture of friend with Facebook ID for "opponent"
  
  
          case 2:
              var cell = tableView.dequeueReusableCellWithIdentifier("cellStyle3", forIndexPath: indexPath) as! cellStyle3
  
              // Configure cell
              cell.label?.text = "" // TODO: Need to put name from opponent _User reference into here
              //             cell.friendProfilePic.image = //Query facebook api for profile picture of friend with Facebook ID for "opponent"
  
  
          default:
              // Default cell with no text
  
              cell.textLabel?.text = ""
  
          }
  
  
          // Configure the cell...
  
          return cell
      }
  </code></pre>