title: How to get the uiimage currently showing in a uiscrollview?
body: <p>I have the following code that takes an array of nsdictionaries that contain the path to a uiimage and add them one by one to the uiscrollview. </p>
  
  <pre><code>- (void)displayAssets:(NSArray*)postAssets //configured for search
  {
      for (UIView *v in self.scrollview.subviews) {
          [v removeFromSuperview];
      }
  
      CGRect workingFrame = self.scrollview.frame;
      workingFrame.origin.x = 0;
  
      self.scrollview.delegate = self;
      //    self.scrollview.contentInset=UIEdgeInsetsMake(10.0,0.0,10.0,0.0);
  
      NSString *pathOfNoImageFile = [[NSBundle mainBundle] pathForResource:@"noimage" ofType:@"png"];
  
      if (postAssets == nil || [postAssets count] == 0) {
  
          UIImage *noImage = [UIImage imageWithContentsOfFile:pathOfNoImageFile];
          UIImageView *imageview = [[UIImageView alloc] initWithImage:noImage];
  
          [imageview setContentMode:UIViewContentModeScaleAspectFit];
          imageview.frame = workingFrame;
          [self.scrollview addSubview:imageview];
      }
      else
      {
  
              //at this moment we have an actual NSArray/NSDictionarry of images that has keys etc.
  
              for (NSDictionary *asset in postAssets) //we have to differentiate between images and videos in future
              {
  
                  //ASSUMING FIRST VALUE IN ASSETS IS AN Image   THIS WILL NEED REFACTORING FOR VIDEOS LATER
                  NSString * assetID = [asset valueForKeyPath:@"id"];
                  NSString * imageURL = [NSString stringWithFormat:@"%@post/7777/images/%@.jpg", WEB_SERVICE_BASE_URL, assetID];
  
                  UIImage *waitingImage = [UIImage imageWithContentsOfFile:pathOfNoImageFile];
                  UIImageView *imageview = [[UIImageView alloc] init];
  
                  [imageview  setImageWithURL:[NSURL URLWithString:imageURL] placeholderImage:waitingImage];
  
                  [imageview setContentMode:UIViewContentModeScaleAspectFit];
                  imageview.frame = workingFrame;
  
                  [self.scrollview addSubview:imageview];
                  workingFrame.origin.x = workingFrame.origin.x + workingFrame.size.width;
              }
              [self.scrollview setContentSize:CGSizeMake(workingFrame.origin.x, workingFrame.size.height)];
  
  
  
      }
  
      //    [[self tableView] reloadData];
  
  }
  </code></pre>
  
  <p>What I am trying to do in another function of the same file is to get the first uiimage or the currently showing uiimage and am unable to do so. Uiscrollview does not seem to have a method that lets one drill down to the individual views so I can get the uiimage. I have looked at other SO questions but they seem way to complex. </p>
  
  <p>Can someone please guide me? I am fairly new to uiscrollviews.</p>
  
  <p>Thank you </p>