title: Unable to load images asynchronous with FSPagerView
body: <p>I have problem displaying the images in the slider because I have to wait for them to download and then load them inside the FSPagerViewCell ImageView.</p>
  
  <p>Inside the delegate function</p>
  
  <pre><code>- (FSPagerViewCell *)pagerView:(FSPagerView *)pagerView cellForItemAtIndex:(NSInteger)index
  </code></pre>
  
  <p>I am using an async function which when the image is ready, returns the downloaded image.
  I use</p>
  
  <pre><code>dispatch_async(dispatch_get_main_queue(), ^{
  </code></pre>
  
  <p>to load the image inside the FSPagerViewCell.imageView</p>
  
  <p>but it doesn't show anything, just white space.</p>
  
  <p>Here is the complete code:</p>
  
  <pre><code>- (FSPagerViewCell *)pagerView:(FSPagerView *)pagerView cellForItemAtIndex:(NSInteger)index
  {
      FSPagerViewCell *cell = [pagerView dequeueReusableCellWithReuseIdentifier:@"pagerCell" atIndex:index];
  
      if (index &lt; [arrMediaGallery count])
      {
      pageControl.currentPage=index;
  
      MediaGallery *firstImage = arrMediaGallery[index];
      NSString *imageName = firstImage.Source;
      NSString *imageURL;
  
      if (imageName != nil &amp;&amp; [imageName isEqualToString:@"NULL"] == NO &amp;&amp; [imageName isEqualToString:@""] == NO) {
  
          imageName = [NSString stringWithFormat:@"thumblarge_%@", imageName];
          imageURL = [NSString stringWithFormat:@"%@/cache/photos/%@", [MyApp sharedInstance].settings.StaticURL, imageName];
      }
  
      UIImage *image = [NetworkUtilities resolveImageWithName:imageName];
  
      if (image == nil) {
  
  
          ProcessServerData *processData = [ProcessServerData new];
          [processData downloadImageForURL:imageURL verifyDownload:NO
                                verifyHash:nil
                              oldImageName:nil
                                parentView:[cell contentView]
                                completion:^(NSError *error) {
  
                                    UIImage* image = [NetworkUtilities resolveImageWithName:[NSString stringWithFormat:@"%@", imageName]];
  
                                    dispatch_async(dispatch_get_main_queue(), ^{
  
                                    [UIView transitionWithView:cell.imageView
                                                      duration:2.0f
                                                       options:UIViewAnimationOptionTransitionCrossDissolve
                                                    animations:^{
                                                        [cell.imageView setImage:image];
                                                    } completion:nil];
                                    });
  
  
                                }];
  
      }
      else {
          [cell.imageView setImage:image];
      }
  
      }
      return cell;
  }
  </code></pre>
  
  <p>Am I doing something wrong?</p>