我有一个带有MKMapView的UIViewController和另一个View(比如说PaintView)在mapView之上。
当用户使用捏合手势触摸PaintView时,下面的mapview应该响应(以及paintView self)。 当用户使用平移手势触摸Paintview时,mapview必须不响应。 (平移手势用于绘画)。
是否有可能将捏合手势转发到mapView?
[self.view addSubview:self.mapView];
[self.view addSubview:self.paintView];
UIPanGestureRecognizer* panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)];
[self.paintView addGestureRecognizer:panRecognizer];
panRecognizer.delegate=self;
UIPinchGestureRecognizer* pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinch:)];
[self.paintView addGestureRecognizer:pinchGesture];
pinchGesture.delegate=self;
-(void)pan:(UIPanGestureRecognizer *)gesture
{
//do sth in the paintView
}
-(void)pinch:(UIPinchGestureRecognizer *)gesture
{
//forward pinch gesture to mapview
//do sth in paintview
}