UITableView: highlight the last cell but other cells get highlighted as well
<p>I have UITableView that I use as a sliding menu as part of SWRevealViewController.</p>

<p>I want to select the last cell in UITableView and implement the following:</p>

<pre><code>override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
    let customCell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! IGAWindAloftMenuTableViewCell

    ...


    let sectionsAmount = tableView.numberOfSections
    let rowsAmount = tableView.numberOfRowsInSection(indexPath.section)

    if (indexPath.section == sectionsAmount - 1 &amp;&amp; indexPath.row == rowsAmount - 1)
    {
        customCell.backgroundColor = UIColor.yellowColor()
    }

    return customCell
}
</code></pre>

<p>When I scroll all the way down, it works -- the last cell is highlighted. However, when I scroll up and down, other cells in the middle of the table get highlighted as well.</p>

<p>Is there any way to prevent it?</p>

<p>Thank you!</p>