You can tell your gesture recognizer and card to work simultaneously by executing the delegate method shouldRecognizeSimultaneouslyWithGestureRecognizer.
When creating tap gestures, set its delegate:
tapGR.delegate = self; //also add <UIGestureRecognizerDelegate> to @interface
and implement the method:
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
shouldRecognizeSimultaneouslyWithGestureRecognizer
:(UIGestureRecognizer *)otherGestureRecognizer
{
return YES;
}
Now your gesture method didSelectAnnotationViewwill be called.
Assuming your crane handler is called first, you can delete and skip scrollview, and then didSelectAnnotationView will create and add scrollview. If the sequence is different, you may need to add several flags to coordinate deletion / creation.
source
share