title: How to get iCarousel current visible view?
body: <p>I am using iCarousal in which I have to use three webviews,five imageviews and two Labels on my iCarousal views a total of 10 iCarousal views.What I need to do is fetch the labels,webviews and imageviews on the basis of tag in the below method and change their values when the iCarousel moves.</p>
  
  <pre><code>- (void)carouselCurrentItemIndexDidChange:(iCarousel *)objcarousel
  </code></pre>
  
  <p>I am getting the current index of the iCarousel by <code>objcarousel.currentItemIndex</code> but when I fetch the views with tag I am unable to get the current view.It gives the second next view.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel
  {
      return MainIndexArray.count;
  }
  
  - (void)carouselCurrentItemIndexDidChange:(iCarousel *)carousel1
  {
  
      if(carousel1.currentItemIndex&lt;3)
      {
  
      }
      else
      {
          UIWebView *WEB=(UIWebView *) [carousel1 viewWithTag:2];
          NSLog(@"WEB====%@",WEB);
  
          [WEB stopLoading];
  
          static NSString *youTubeVideoHTML = @"&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;style&gt;body{margin:0px 0px 0px 0px;}&lt;/style&gt;&lt;/head&gt; &lt;body&gt; &lt;div id=\"player\"&gt;&lt;/div&gt; &lt;script&gt; var tag = document.createElement('script'); tag.src = \"http://www.youtube.com/player_api\"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player; function onYouTubePlayerAPIReady() { player = new YT.Player('player', { width:'%0.0f', height:'%0.0f', videoId:'%@', events: { 'onReady': onPlayerReady, } }); } function onPlayerReady(event) { event.target.playVideo(); } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;";
  
          NSLog(@"currentItemIndex=====%d",carousel1.currentItemIndex);
  
          NSString *html = [NSString stringWithFormat:youTubeVideoHTML, WEB.frame.size.width, WEB.frame.size.height,[YouTubeUrlArray objectAtIndex:0]];
  
          [WEB loadHTMLString:html baseURL:[[NSBundle mainBundle] resourceURL]];
  
      } 
  }
  
  
  - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
  {
      UILabel *label = nil;
      UIWebView *web=nil;
  
      //create new view if no view is available for recycling
      if (view == nil)
      {
          view = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 280, 200.0f)];
          ((UIImageView *)view).image = [UIImage imageNamed:@"page.png"];
          view.contentMode = UIViewContentModeCenter;
  
          if(index&lt;3)
          {
              label = [[UILabel alloc] initWithFrame:view.bounds];
              label.backgroundColor = [UIColor grayColor];
              label.textAlignment = NSTextAlignmentCenter;
              label.font = [label.font fontWithSize:50];
              label.tag = 1;
              [view addSubview:label];
  
          }
          else
          {
              web=[[UIWebView alloc]initWithFrame:view.bounds];
              web.tag=2;
              [view addSubview:web];
          }
      }
      else
      {
          //get a reference to the label in the recycled view
  
          if(index&lt;3)
          {
              label = (UILabel *)[view viewWithTag:1];
          }
          else
          {
              web=(UIWebView*) [view viewWithTag:2];
          }
      }
  
  
      if(index&lt;3)
      {
          label.text = [MainIndexArray objectAtIndex:index];
      }
      else
      {
          [web loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
      }
  
      return view;
  }
  </code></pre>
  
  <p>So please suggest me what should I do to get the current label or current webview or current imageview when iCarousel scrolls.</p>