In one of my projects, I needed to highlight my image by immediately touching the camera, so I implemented the backlight state in Ios 5.0 like this. These functions are written to the custom cell class. Change these features to suit your requirements.
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [self hightlightImage]; [self performSelector:@selector(detecetedLongTap) withObject:nil afterDelay:1.0]; [super touchesBegan:touches withEvent:event]; } -(void)detecetedLongTap{ [self hightlightImage]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesMoved:touches withEvent:event]; } -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { if (titleLabel.textColor == [UIColor blackColor]) [self hightlightImage]; [super touchesEnded:touches withEvent:event]; }
Divyu source share