title: Display UIImage with an image from a URL
body: <p>I am trying to display a list of items. My end game is displaying a grid of images from an array of Strings that are URLs and file names on my IOS app.</p>
  
  <p>I have a CollectionView that is displaying a grid of images via an array of String filenames, and that works:</p>
  
  <p>Array:</p>
  
  <pre><code>var tableImages: [String] = ["car.jpg", "bus.jpg", "plane.jpg"]
  </code></pre>
  
  <p>code that works:</p>
  
  <pre><code>cell.imgCell.image = UIImage(named: tableImages[indexPath.row])
  </code></pre>
  
  <p>My next step is figuring out the code for displaying a grid of images via an array of String urls. And that is my question. How do I display an image from a url?</p>
  
  <p>Array: </p>
  
  <pre><code>var tableImages: [String] = ["http://www.hotelstmarie.com/wp-content/uploads/2014/12/HSM_Guest-Rooms_1500x750-06-02-2015.jpg", "http://media-cdn.tripadvisor.com/media/photo-s/03/4f/b0/58/aviva-by-kameel.jpg"]
  </code></pre>
  
  <p>code that works:</p>
  
  <pre><code>?
  </code></pre>
  
  <p><strong>Notes:</strong> </p>
  
  <p>I have checked other stackoverflow questions on the matter but they are from years ago and the move to swift has made their answers out of date. </p>
  
  <p>After I figure out how to display url images I will just make some if statements to recognize url or filename to make it to my endgame, but that is not part of this question.</p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>Code around my code above:</p>
  
  <pre><code>func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
      let cell: CollViewCell = collectionView.dequeueReusableCellWithReuseIdentifier("Cell", forIndexPath: indexPath) as! CollViewCell
      cell.labelCell.text = tableData[indexPath.row]
      cell.imgCell.image = UIImage(named: tableImages[indexPath.row])
      return cell
  }
  </code></pre>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Using Alamofire:</p>
  
  <pre><code>func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
      let cell: CollViewCell = collectionView.dequeueReusableCellWithReuseIdentifier("Cell", forIndexPath: indexPath) as! CollViewCell
      cell.labelCell.text = tableData[indexPath.row]
      let imageUrl = NSURL(string: tableImages[indexPath.row])
      cell.imgCell.af_setImageWithUrl(imageUrl, placeholderImage: nil, filter: nil, imageTransition: .CrossDissolve(0.2))
      return cell
  }
  </code></pre>
  
  <p>Gives this error:</p>
  
  <pre><code>Value of type 'UIImageView' has no member 'af_setImageWithUrl'
  </code></pre>