fixes #42: allow for simultaneous pan, pinch, and rotate

This commit is contained in:
Justin R. Miller
2014-02-05 15:59:16 -05:00
parent dd3687061d
commit 61c69f5872

View File

@@ -16,7 +16,7 @@
#include <llmr/llmr.hpp>
#include <llmr/platform/platform.hpp>
@interface MBXViewController ()
@interface MBXViewController () <UIGestureRecognizerDelegate>
@property (nonatomic) EAGLContext *context;
@property (nonatomic) CGPoint center;
@@ -83,6 +83,7 @@ class MBXMapView
mapView->init();
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)];
pan.delegate = self;
[self.view addGestureRecognizer:pan];
UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTapGesture:)];
@@ -105,9 +106,11 @@ class MBXMapView
[self.view addGestureRecognizer:threeFingerLongPress];
UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)];
pinch.delegate = self;
[self.view addGestureRecognizer:pinch];
UIRotationGestureRecognizer *rotate = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(handleRotateGesture:)];
rotate.delegate = self;
[self.view addGestureRecognizer:rotate];
}
@@ -209,6 +212,11 @@ class MBXMapView
}
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
return YES;
}
CADisplayLink *displayLink;
MBXMapView *mapView;
NSOperationQueue *queue;