Skip to content

Instantly share code, notes, and snippets.

@giulio92
Last active July 15, 2016 15:28
Show Gist options
  • Select an option

  • Save giulio92/1cc878386d6a6a2c3bca70ca78136e1a to your computer and use it in GitHub Desktop.

Select an option

Save giulio92/1cc878386d6a6a2c3bca70ca78136e1a to your computer and use it in GitHub Desktop.

Revisions

  1. giulio92 revised this gist Jul 15, 2016. No changes.
  2. giulio92 revised this gist Jul 1, 2016. No changes.
  3. giulio92 revised this gist Jul 1, 2016. No changes.
  4. giulio92 revised this gist Jul 1, 2016. No changes.
  5. giulio92 revised this gist Jul 1, 2016. No changes.
  6. giulio92 revised this gist Jul 1, 2016. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion GMSMapView+DisableDoubleTapZoom.h
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,4 @@

    - (void)setDoubleTapZoomEnabled:(BOOL)enabled;

    @end
    @end
    2 changes: 1 addition & 1 deletion GMSMapView+DisableDoubleTapZoom.m
    Original file line number Diff line number Diff line change
    @@ -19,4 +19,4 @@ - (void)setDoubleTapZoomEnabled:(BOOL)enabled {
    }
    }

    @end
    @end
  7. giulio92 revised this gist Jul 1, 2016. No changes.
  8. giulio92 revised this gist Jul 1, 2016. No changes.
  9. giulio92 created this gist Jul 1, 2016.
    7 changes: 7 additions & 0 deletions GMSMapView+DisableDoubleTapZoom.h
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    #import <GoogleMaps/GoogleMaps.h>

    @interface GMSMapView (DisableDoubleTapZoom)

    - (void)setDoubleTapZoomEnabled:(BOOL)enabled;

    @end
    22 changes: 22 additions & 0 deletions GMSMapView+DisableDoubleTapZoom.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #import "GMSMapView+DisableDoubleTapZoom.h"

    @implementation GMSMapView (DisableDoubleTapZoom)

    - (void)setDoubleTapZoomEnabled:(BOOL)enabled {
    for (id view in [self subviews]) {
    if ([view isKindOfClass:NSClassFromString(@"GMSVectorMapView")] ) {
    for (UITapGestureRecognizer *rec in [view gestureRecognizers]) {
    NSRange range1 = [[rec description] rangeOfString:@"action=handleZoomTapGesture:"];
    NSRange range2 = [[rec description] rangeOfString:@"action=handleSingleTapGesture:"];

    if (range1.location && range2.location && range1.location < range2.location) {
    [rec setEnabled:enabled];

    break;
    }
    }
    }
    }
    }

    @end