title: image from server side to UICollectionView
body: <pre><code>var expoImage: [String] = []
  </code></pre>
  
  <p>i have get the value from mySQL Database and all its coming and one of them is URL link for image that and its save in the same web host</p>
  
  <pre><code>func loadData() {
  
      let url = NSURL(string: "http://www.q8-9ndo5aan.com/kuwaitExpoApps/script/getExpo.php")
      let request = NSMutableURLRequest(URL: url!)
  
      // modify the request as necessary, if necessary
  
      NSURLSession.sharedSession().dataTaskWithRequest(request, completionHandler: { (data:NSData?, response:NSURLResponse?, error:NSError?) -&gt; Void in
  
          dispatch_async(dispatch_get_main_queue(), { 
  
              if error != nil {
                  // Display an alert message
  
                  print(error)
  
                  return
              }
  
              do {
  
                  let json = try NSJSONSerialization.JSONObjectWithData(data!, options: .MutableContainers) as? [[String:AnyObject]]
  
  
                  if (json != nil) {
  
                      for item in json! {
  
                  self.expoImage.append((item["expoImage"] as? String)!)
  
                          self.myCollectionView.reloadData()
  
                      }
  
                      // Display an alert message
  
  
                  } else {
  
                      // Display an alert message
                      let userMessage = "Could not fetch Value"
                      print(userMessage)
  
                  }
  
  
  
              } catch  {
  
                  print(error)
  
              }
  
          })
  
      }).resume()
  
  
  }
  </code></pre>
  
  <p>and when i print in console of Xcode the link displayed well , but my problem is did not displayed the image in the UICollectionView</p>
  
  <pre><code>func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
  
      let myCell: myCollectionViewCell = collectionView.dequeueReusableCellWithReuseIdentifier("myCell", forIndexPath: indexPath) as! myCollectionViewCell
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), {
  
          let imageString = self.expoImage[indexPath.row]
          let imageUrl = NSURL(string: imageString)
          let imageData = NSData(contentsOfURL: imageUrl!)
  
          dispatch_async(dispatch_get_main_queue(), {
  
              if(imageData != nil) {
  
                  myCell.expoImage.image = UIImage(data: imageData!)
                  myCell.expoImageBack.image = UIImage(data: imageData!)
  
              }
  
          });
  
      });
  
      return myCell
  
  }
  </code></pre>
  
  <p>any one have ideas for that</p>