title: iOS FadeIn/FadeOut during paging
body: <p>I have an UIScrollView with views inside that I can scroll horizontally. During the scroll I would like to add a fade out on the view which is going out of the screen and a fade in on the view which is going in the screen.</p>
  
  <p>Here my code : </p>
  
  <pre><code> for (int i = 0; i &lt;textEntries.count; i++)
      {
          CGRect frame;
          frame.origin.x = self.scrollView.frame.size.width * i + 5;
          frame.size.width = self.scrollView.frame.size.width - 10;
          frame.size.height = self.scrollView.frame.size.height - 10;
          self.scrollView.pagingEnabled = YES;
  
          UIView *subview = [[UIView alloc] initWithFrame:frame];
          if([[colorEntries objectAtIndex:i] isEqualToString:@"violet"]){
              subview.backgroundColor = [UIColor colorWithRed:(147/255.0) green:(90/255.0) blue:(255/255.0) alpha:1];
          } else {
              subview.backgroundColor = [UIColor colorWithRed:(100/255.0) green:(166/255.0) blue:(255/255.0) alpha:1];
          }
          subview.layer.cornerRadius = 5;
          [self.scrollView addSubview:subview];
  
          UITextView *noteLabel = [[UITextView alloc] init];
          noteLabel.frame = CGRectMake(0, 0, self.scrollView.frame.size.width - 20, self.scrollView.frame.size.height -20);
          noteLabel.text = [textEntries objectAtIndex:i];
          noteLabel.userInteractionEnabled = NO;
          noteLabel.backgroundColor = [UIColor clearColor];
          noteLabel.contentInset = UIEdgeInsetsMake(20,20,20,20);
          noteLabel.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:40];
          [noteLabel setTextColor:[UIColor whiteColor]];
          [subview addSubview:noteLabel];
          [noteLabel addObserver:self forKeyPath:@"contentSize" options:(NSKeyValueObservingOptionNew) context:NULL];
  
  
      }
  </code></pre>
  
  <p>Could you help me to build this fadeIn/FadeOut effect ?
  Thanks!</p>