diff options
author | Wilhelm Berg <wb@BergWerk-GIS.at> | 2018-09-12 15:07:57 +0200 |
---|---|---|
committer | Wilhelm Berg <wb@BergWerk-GIS.at> | 2018-09-12 15:07:57 +0200 |
commit | 98b34cb0dbf5c50d7f319724c93021418140b15f (patch) | |
tree | 11cd51f86b5c672dda6bfe087f40f77df1553971 /platform/ios/app/MBXViewController.m | |
parent | ee17d79f9420eb859303d977955454dacc470db6 (diff) | |
parent | 079ba0209ed383c15123902f0810e658c2b0abf4 (diff) | |
download | qtlocation-mapboxgl-98b34cb0dbf5c50d7f319724c93021418140b15f.tar.gz |
Merge remote-tracking branch 'origin' into bwg-vs2017upstream/bwg-vs2017
# Conflicts:
# cmake/mason-dependencies.cmake
Diffstat (limited to 'platform/ios/app/MBXViewController.m')
-rw-r--r-- | platform/ios/app/MBXViewController.m | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 259c1191bc..02652b5490 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -271,6 +271,16 @@ CLLocationCoordinate2D randomWorldCoordinate() { [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 @@ -1830,6 +1840,14 @@ CLLocationCoordinate2D randomWorldCoordinate() { #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) |