title: How to load image in swift using Alamofire
body: <p>I have a collection view controller, which load image Async by URL.
  (Something like Instegram)
  I am looking for the best way to implement the part of the loading image.
  please tell me what do you think</p>
  
  <p>First way - without any external library:</p>
  
  <pre><code>   let downloadQueue = dispatch_queue_create("com.pro.asyncImages",nil)
      dispatch_async(downloadQueue){
  
          var data = NSData(contentsOfURL: NSURL(string: pictureUrl!)!)
  
          var image: UIImage?
          if (data != nil){
              image = UIImage(data: data!)
          }
          dispatch_async(dispatch_get_main_queue()){
              uiImageView.image = image
          }
      }
  </code></pre>
  
  <p>Second way -  using Alamofire (the request belong to Alamofire)</p>
  
  <pre><code>if let  mediaUrl = info.mediaUrl {
          request(.GET,mediaUrl).response(){
              (_, _, data, _) in
              let image = UIImage(data: data! as NSData)
              imageView.image = image
          }
      }
  </code></pre>
  
  <p>And lastly, I read that AFNetworking, is doing a great job in loading url async to urlImage, Which this is what I want to do.</p>
  
  <p>So is AFNetworking is better for this task? (then Alamofire)
  and if not, I did not understand how to add AFNetworking to my swift project, beside adding the #import “AFNetworking.h” which files do I need to add?</p>
  
  <p>please explain which method is the best, my needs are performance, accusation,  caching.
  the view collection controller acts like Instegram and is loading images, while scrolling down.
  I hope I was clear enough about what I need,
   thank you</p>