There I need to add touch event on UTableViewController
Like there will be an image w.r.t. to each UICell, so when user touches any cell corresponding image will be visible to user, Image will only visible to user screen has touch event on it. When user put finger up from screen, image will be hidden again.
Please guide to achieve this
You can change your image using UILongPressGestureRecognizer.You can add gesture to your cell and you can change your image in hangleLongPress method.
UILongPressGestureRecognizer *lpgr = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
lpgr.minimumPressDuration = 1.0; //user must hold for 1 second
[cell addGestureRecognizer:lpgr];
- (void)handleLongPress:(UIGestureRecognizer *)gestureRecognizer
{
if (gestureRecognizer.state == UIGestureRecognizerStateBegan)
{
// ----------------- Make here image visible ----------
}
if (gestureRecognizer.state == UIGestureRecognizerStateEnded)
{
// ------------ Make here image invisible ----------
}
}