TGURLHandler

@protocol TGURLHandler <NSObject>

A URL Handler interface for creating cancellable asynchronous URL requests.

  • Create an asynchronous download request.

    Note

    This method will be automatically called by the map view instance.

    Declaration

    Objective-C

    - (NSUInteger)downloadRequestAsync:(nonnull NSURL *)url
                     completionHandler:
                         (nonnull TGDownloadCompletionHandler)completionHandler;

    Swift

    func downloadRequestAsync(_ url: URL, completionHandler: @escaping TGDownloadCompletionHandler) -> UInt

    Parameters

    url

    The URL to download.

    completionHandler

    A handler to be called once the URL request completed.

    Return Value

    A task identifier that uniquely identifies the URL request within this handler.

  • Cancel a previous download request.

    Declaration

    Objective-C

    - (void)cancelDownloadRequestAsync:(NSUInteger)taskIdentifier;

    Swift

    func cancelDownloadRequestAsync(_ taskIdentifier: UInt)

    Parameters

    taskIdentifier

    The task identifier for the request to cancel.