summaryrefslogtreecommitdiff
path: root/platform/ios/app/MBXViewController.m
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/app/MBXViewController.m')
-rw-r--r--platform/ios/app/MBXViewController.m18
1 files changed, 18 insertions, 0 deletions
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 0f617188b9..917abb08d6 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -206,6 +206,16 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
}
[self presentViewController:alertController animated:YES completion:nil];
}
+
+ // Add fall-through single tap gesture recognizer. This will be called when
+ // the map view's tap recognizers fail.
+ UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
+ for (UIGestureRecognizer *gesture in self.mapView.gestureRecognizers) {
+ if ([gesture isKindOfClass:[UITapGestureRecognizer class]]) {
+ [singleTap requireGestureRecognizerToFail:gesture];
+ }
+ }
+ [self.mapView addGestureRecognizer:singleTap];
}
- (void)saveState:(__unused NSNotification *)notification
@@ -1562,6 +1572,14 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
#pragma mark - User Actions
+- (void)handleSingleTap:(UITapGestureRecognizer *)singleTap {
+ [self.navigationController setNavigationBarHidden:!self.navigationController.navigationBarHidden animated:YES];
+
+ // This is how you'd get the coordinate for the point where the user tapped:
+ // CGPoint tapPoint = [singleTap locationInView:self.mapView];
+ // CLLocationCoordinate2D tapCoordinate = [self.mapView convertPoint:tapPoint toCoordinateFromView:nil];
+}
+
- (IBAction)handleLongPress:(UILongPressGestureRecognizer *)longPress
{
if (longPress.state == UIGestureRecognizerStateBegan)