IPhone: Custom UITableViewCell with multiple areas that respond to cranes?

I was asked to create a custom UITableViewCell with several areas that can be used.

In these areas there are no buttons or graphics - they will be invisible. 3 different methods will be called depending on which third cell the user types.

|| decrement FooCount || viewFooDetails || incrementFooCount ||

There are several shortcuts in the cell that should be visible at all times - fooName and fooCount.

I think maybe three hidden UIButtons above the cell?

I also need to save the swipe to remove the default behavior.

+3
source share
1

UITableViewCell touchesBegan:withEvent:. CGPoint, .

- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
   UITouch* touch = touches.anyObject;
   CGPoint location = [touch locationInView:self];

   if (CGRectContainsPoint(myTestRect, location)) {
       // Touched inside myTestRect, do whatever...
   } else {
      // Let the default implementation take over.
      [super touchesBegan:touches withEvent:event];
   }
}

+5

Source: https://habr.com/ru/post/1736253/


All Articles