Protocols

The following protocols are available globally.

  • A map view delegate can receive various map events.

    Note

    All of these methods are called from main thread, these methods are all optional.
    See more

    Declaration

    Objective-C

    @protocol TGMapViewDelegate <NSObject>

    Swift

    protocol TGMapViewDelegate : NSObjectProtocol
  • 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 if shouldRecognize* returns YES.

    • 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 a UIKit 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.
    See more

    Declaration

    Objective-C

    @protocol TGRecognizerDelegate <NSObject>

    Swift

    protocol TGRecognizerDelegate : NSObjectProtocol
  • A URL Handler interface for creating cancellable asynchronous URL requests.

    See more

    Declaration

    Objective-C

    @protocol TGURLHandler <NSObject>

    Swift

    protocol TGURLHandler : NSObjectProtocol