title: insert & remove subview from UIScrollView while dragging
body: <p>I have put multiple <code>UIButton</code> (as cards) as subview in <code>UIScrollView</code> according to array count, fetched from database. Apart from that i am able to succeed to develop Infinite scrolling &amp; it is just working fine. So I have on option called "remember". As soon as i tap on remember, card (<code>UIButton</code> as subview) must show up less often in scrolling. How can i achieve this i.e array at particular index must show less often in <code>UIScrollView</code>.Any logic or idea? Here is my code till infinite scrolling:</p>
  
  <pre><code>-(void)createCards
  {     
  [self addCardWithName:[NSString stringWithFormat:@"%@",[entryArray objectAtIndex:      
  ([entryArray count]-1)]] atPosition:0];
  
  for (int i = 1; i &lt; ([entryArray count]+1); i++) {
      NSString *titleString = [NSString stringWithFormat:@"%@",[entryArray objectAtIndex:i-1] ];
      UIButton *buttonView1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
      [buttonView1 setFrame:CGRectMake(i*320, 0, 320, 180)];
      [buttonView1 setTitle:titleString forState:UIControlStateNormal];
      buttonView1.tag=i;
      [scrollViewForCard addSubview:buttonView1];
  }
  
  [self addCardWithName:[NSString stringWithFormat:@"%@",[entryArray objectAtIndex:0]] atPosition:([entryArray count]+1)];
  
  scrollViewForCard.contentSize = CGSizeMake(480*([entryArray count]+1), 180);
  [scrollViewForCard scrollRectToVisible:CGRectMake(320,0,320,180) animated:NO];
  }
  
  - (void)addCardWithName:(NSString*)titleString atPosition:(int)position
  {
   UIButton *buttonView1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
  [buttonView1 setFrame:CGRectMake(position*320, 0, 320, 180)];
  [buttonView1 setTitle:titleString forState:UIControlStateNormal];
  [scrollViewForCard addSubview:buttonView1];
  }
  
  #pragma mark scroll view-delegate
  
  - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
  {
   int randomInt2 = arc4random() % [entryArray count];    
  }
  
  - (void)scrollViewDidEndDecelerating:(UIScrollView *)sender 
  {    
  if (sender.contentOffset.x == 0) {
      [sender scrollRectToVisible:CGRectMake((320*[entryArray count]),0,320,180) animated:NO];
  }
  else if (sender.contentOffset.x == ([entryArray count]+1)*320) {
      [sender scrollRectToVisible:CGRectMake(320,0,320,180) animated:NO];
  }
  }
  </code></pre>