For example: I have UIView
and I detect long press - so then new UIView
appears. It takes whole screen now. I still have finger down on the screen - I can move finger but I can't move up, beacause then my new UIView
will disappear. So now I have to detect touches on my new UIView
but neither touchesBegan nor touchesMoved
is being called. Is there any way to solve this problem?
Code of my new UIView
:
#import "Menu.h"
@implementation Menu
{
// int x;
// int y;
UIGestureRecognizer *longPressGesture;
}
- (id)initWithFrame:(CGRect)frame
{
NSLog(@"initWithFrame");
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor orangeColor];
self.userInteractionEnabled = YES;
[self setMultipleTouchEnabled:YES];
[self setIsAccessibilityElement:YES];
longPressGesture = [[UIGestureRecognizer alloc]
initWithTarget:self
action:@selector(longPressBegan:)];
[self addGestureRecognizer:longPressGesture];
}
return self;
}
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"TOUCHES BEGAN");
}
-(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"TOUCHES MOVED");
}
-(void)longPressBegan:(UIGestureRecognizer *)recognizer
{
NSLog(@"LONG PRESS");
}
And none of these methods (touchesBegan, touchesMoved,longPressBegan) is called.