TGRecognizerDelegate
@protocol TGRecognizerDelegate <NSObject>
The TGGestureDelegate
protocol can be implemented to receive gesture events from the map view. The map view will
first check whether a gestureDelegate is set, then check whether it responds to any shouldRecognize*
method:
If the delegate responds to
shouldRecognize*
, the map view only performs its default handling of the gesture ifshouldRecognize*
returnsYES
.If the delegate doesn’t respond to
shouldRecognize*
, the map view performs its default handling of the gesture.
Finally, if the delegate implements didRecognize*
then the map view calls this method after the gesture is handled.
Note
These methods are all optional. All the screen positions in this interface are in logical pixels or drawing coordinate system (based on aUIKit
coordinate system) which is independent of the phone pixel density.
Refer to the
Apple documentation regarding Coordinate Systems and Drawing in iOS for more informations.
-
Whether the map view should handle a single tap gesture.
Declaration
Objective-C
- (BOOL)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer shouldRecognizeSingleTapGesture:(CGPoint)location;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, shouldRecognizeSingleTapGesture location: CGPoint) -> Bool
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
that recognized the gesture.location
The location of the recognized gesture in the view.
Return Value
YES
if the map view should handle this gesture, otherwiseNO
. -
Whether the map view should handle a double tap gesture.
Declaration
Objective-C
- (BOOL)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer shouldRecognizeDoubleTapGesture:(CGPoint)location;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, shouldRecognizeDoubleTapGesture location: CGPoint) -> Bool
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
that recognized the gesture.location
The location of the recognized gesture in the view.
Return Value
YES
if the map view should handle this gesture, otherwiseNO
. -
Whether the map view should handle a long press gesture.
Declaration
Objective-C
- (BOOL)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer shouldRecognizeLongPressGesture:(CGPoint)location;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, shouldRecognizeLongPressGesture location: CGPoint) -> Bool
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
that recognized the gesture.location
The location of the recognized gesture in the view.
Return Value
YES
if the map view should handle this gesture, otherwiseNO
. -
Whether the map view should handle a pan gesture.
Declaration
Objective-C
- (BOOL)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer shouldRecognizePanGesture:(CGPoint)displacement;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, shouldRecognizePanGesture displacement: CGPoint) -> Bool
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
that recognized the gesture.displacement
The displacement of the recognized gesture in the view.
Return Value
YES
if the map view should handle this gesture, otherwiseNO
. -
Whether the map view should handle a pinch gesture.
Declaration
Objective-C
- (BOOL)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer shouldRecognizePinchGesture:(CGPoint)location;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, shouldRecognizePinchGesture location: CGPoint) -> Bool
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
that recognized the gesture.location
The position of the recognized gesture in the view.
Return Value
YES
if the map view should handle this gesture, otherwiseNO
. -
Whether the map view should handle a rotation gesture.
Declaration
Objective-C
- (BOOL)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer shouldRecognizeRotationGesture:(CGPoint)location;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, shouldRecognizeRotationGesture location: CGPoint) -> Bool
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
that recognized the gesture.location
The position of the recognized gesture in the view.
Return Value
YES
if the map view should handle this gesture, otherwiseNO
. -
Whether the map view should handle a shove gesture.
Declaration
Objective-C
- (BOOL)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer shouldRecognizeShoveGesture:(CGPoint)displacement;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, shouldRecognizeShoveGesture displacement: CGPoint) -> Bool
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
that recognized the gesture.displacement
The displacement of the recognized gesture in the view.
Return Value
YES
if the map view should handle this gesture, otherwiseNO
. -
If implemented, the returned value will be the focus for the rotation gesture.
Declaration
Objective-C
- (CGPoint)rotationFocus:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer;
Swift
optional func rotationFocus(_ view: TGMapView!, recognizer: UIGestureRecognizer!) -> CGPoint
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
that recognized the gesture.Return Value
The screen position the rotation gesture should focus to.
-
If implemented, the returned value will be the focus for the pinch gesture.
Declaration
Objective-C
- (CGPoint)pinchFocus:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer;
Swift
optional func pinchFocus(_ view: TGMapView!, recognizer: UIGestureRecognizer!) -> CGPoint
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
that recognized the gesture.Return Value
The screen position the pinch gesture should focus to.
-
Called when the map view just handled a single tap gesture.
Declaration
Objective-C
- (void)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer didRecognizeSingleTapGesture:(CGPoint)location;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, didRecognizeSingleTapGesture location: CGPoint)
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
the recognized the gesture.location
The position of the recognized gesture in the view.
-
Called when the map view just handled a single double tap gesture.
Declaration
Objective-C
- (void)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer didRecognizeDoubleTapGesture:(CGPoint)location;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, didRecognizeDoubleTapGesture location: CGPoint)
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
the recognized the gesture.location
The position of the recognized gesture in the view.
-
Called when the map view just handled a long press gesture.
Declaration
Objective-C
- (void)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer didRecognizeLongPressGesture:(CGPoint)location;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, didRecognizeLongPressGesture location: CGPoint)
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
the recognized the gesture.location
The position of the recognized gesture in the view.
-
Called when the map view just handled a pan gesture.
Declaration
Objective-C
- (void)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer didRecognizePanGesture:(CGPoint)displacement;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, didRecognizePanGesture displacement: CGPoint)
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
the recognized the gesture.displacement
The displacement of the recognized gesture in the view.
-
Called when the map view just handled a pinch gesture.
Declaration
Objective-C
- (void)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer didRecognizePinchGesture:(CGPoint)location;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, didRecognizePinchGesture location: CGPoint)
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
the recognized the gesture.location
The position of the recognized gesture in the view.
-
Called when the map view just handled a rotation gesture.
Declaration
Objective-C
- (void)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer didRecognizeRotationGesture:(CGPoint)location;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, didRecognizeRotationGesture location: CGPoint)
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
the recognized the gesture.location
The position of the recognized gesture in the view.
-
Called when the map view just handled a shove gesture.
Declaration
Objective-C
- (void)mapView:(TGMapView *)view recognizer:(UIGestureRecognizer *)recognizer didRecognizeShoveGesture:(CGPoint)displacement;
Swift
optional func mapView(_ view: TGMapView!, recognizer: UIGestureRecognizer!, didRecognizeShoveGesture displacement: CGPoint)
Parameters
view
The map view instance.
recognizer
The
UIGestureRecognizer
the recognized the gesture.displacement
The displacement of the recognized gesture in the view.