title: Swift reusable cell image being reused
body: <p>I am trying to have an image appear in certain cells of my UITableView only under certain conditions. When the conditions are met, the image appears as expected, but when I scroll down the list, the icon is seen in a cell towards the bottom, even though the condition was NOT met. I am gessing that this has something to the with the cell being a prototype and being reused in code, but cannot figure out how to fix. Here is the code I have:</p>
  
  <pre><code>override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("locCell", forIndexPath: indexPath)
  
    var currentLoc = self.hereLocs[indexPath.row]
    var hereImage = UIImage(named: "loc")
  
    if currentLoc.currentlyHere! == true {
      cell.textLabel?.text = currentLoc.name!
      cell.detailTextLabel?.text = currentLoc.vicinity!
      cell.imageView?.image = hereImage
    } else {
      cell.textLabel?.text = currentLoc.name!
      cell.detailTextLabel?.text = currentLoc.vicinity!
    }
  
    return cell
  }
  </code></pre>