title: iPhone/Cocoa Touch - Change UITableViewCell background from one color to another
body: <p>I want to change the color of a UITableViewCell slowly from one color to another <strong>WHILE</strong> I m holding (tap holding) the cell for a specific duration. </p>
  
  <p>After that duration it should do a action.. Its just like Whatsapps row selection on Android..
  It starts first bright and ends with a darkest color..</p>
  
  <p>I tried that already with a gesture recognizer but that didn't work..</p>
  
  <p>Is that possible? I would appreciate a sample code.</p>
  
  <p><strong>EDIT 1:</strong></p>
  
  <pre><code>-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  
      CostumEventCell *cell = [eventsTable cellForRowAtIndexPath:indexPath];
      [cell setBackgroundColor:[UIColor colorWithRed:(252/255.0) green:(213/255.0) blue:(183/255.0) alpha:1]];
  
      [UIView animateWithDuration:3.0 animations:^(void) {
          [cell setBackgroundColor:[UIColor colorWithRed:(204/255.0) green:(85/255.0) blue:(0/255.0) alpha:1]];
      }];
  }
  </code></pre>
  
  <p>** EDIT 2 (with gesture recognizer):**</p>
  
  <pre><code>- (void) createGestureListener{
      UILongPressGestureRecognizer* longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(onLongPress:)];
      longPressRecognizer.delegate = self;
      [self.eventsTable addGestureRecognizer:longPressRecognizer];
  
  
  }
  
      -(void)onLongPress:(UILongPressGestureRecognizer*)pGesture
      {
  
          CGPoint touchPoint = [pGesture locationInView:self.view];
          NSIndexPath* row = [eventsTable indexPathForRowAtPoint:touchPoint];
  
          if (pGesture.state == UIGestureRecognizerStateBegan)
          {
              //Do something to tell the user!
              NSLog(@"Tap started");
              CostumEventCell *cell = [eventsTable cellForRowAtIndexPath:row];
  
              [UIView animateWithDuration:3.0 animations:^(void) {
                  [cell setBackgroundColor:[UIColor colorWithRed:(252/255.0) green:(213/255.0) blue:(183/255.0) alpha:1]];
                  [cell setBackgroundColor:[UIColor colorWithRed:(204/255.0) green:(85/255.0) blue:(0/255.0) alpha:1]];
              }];
          }
      }
  </code></pre>