title: How to debug "Thread 1: Fatal error: Index out of range in Swift"
body: <p>I have a problem with a Swift code:</p>
  
  <pre><code>override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
  
      let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
      cell.textLabel?.backgroundColor = UIColor.clear
      cell.detailTextLabel?.backgroundColor = UIColor.clear
  
      if indexPath.row % 2 == 0 {
          cell.backgroundColor = UIColor(white: 1, alpha: 0.1)
      } else {
          cell.backgroundColor = UIColor(white: 1, alpha: 0.2)
      }
  
      // Load feed iamge.
      let url = NSURL(string:feedImgs[indexPath.row] as! String) //** The problem - Thread 1: Fatal error: Index out of range**
      let data = NSData(contentsOf:url! as URL)
      var image = UIImage(data:data! as Data)
      image = resizeImage(image: image!, toTheSize: CGSize(width: 80, height: 80))
      let cellImageLayer: CALayer?  = cell.imageView?.layer
      cellImageLayer!.cornerRadius = 35
      cellImageLayer!.masksToBounds = true
      cell.imageView?.image = image
      cell.textLabel?.text = (myFeed.object(at: indexPath.row) as AnyObject).object(forKey: "title") as? String
      cell.textLabel?.textColor = UIColor.white
      cell.textLabel?.numberOfLines = 0
      cell.textLabel?.lineBreakMode = .byWordWrapping
  
      cell.detailTextLabel?.text = (myFeed.object(at: indexPath.row) as AnyObject).object(forKey: "pubDate") as? String
      cell.detailTextLabel?.textColor = UIColor.white
  
      return cell
  }
  </code></pre>
  
  <p>How can I solve that?</p>