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.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 anyshouldRecognize*
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.Declaration
Objective-C
@protocol TGRecognizerDelegate <NSObject>
Swift
protocol TGRecognizerDelegate : NSObjectProtocol
-
A URL Handler interface for creating cancellable asynchronous URL requests.
See moreDeclaration
Objective-C
@protocol TGURLHandler <NSObject>
Swift
protocol TGURLHandler : NSObjectProtocol