TKAutocompleting

public protocol TKAutocompleting

Undocumented

  • Called whenever a user types a character. You can assume this is already throttled.

    Declaration

    Swift

    func autocomplete(_ input: String, near mapRect: MKMapRect, completion: @escaping (Result<[TKAutocompletionResult], Error>) -> Void)

    Parameters

    input

    Query fragment typed by user

    mapRect

    Last map rect the map view was zoomed to (can be MKMapRectNull)

    completion

    Handled called with the autocompletion results for query fragment. Should fire with empty result or error out if nothing found. Needs to be called, unless cancelAutocompletion was called.

  • Called to fetch the annotation for a previously returned autocompletion result

    Declaration

    Swift

    func annotation(for result: TKAutocompletionResult, completion: @escaping (Result<MKAnnotation?, Error>) -> Void)

    Parameters

    result

    The result for which to fetch the annotation

    completion

    Completion handler that’s called with the annotation for the result, if representable as such. Called with nil if not representable, or can also be called with an error if it is representable but the conversion failed. Needs to be called.

  • cancelAutocompletion() Default implementation

    Called when previously requested autocompletion result is no longer relevant. Use this to clean up resources.

    Default Implementation

    Declaration

    Swift

    func cancelAutocompletion()
  • additionalActionTitle() Default implementation

    Text and action for an additional row to display in the results, e.g., to request user permissions if the autocompletion provider can’t provide results without that.

    The Single should fire on completion of the action (e.g., asking for permission) indicating if the results or texts should be refreshed.

    Default Implementation

    Declaration

    Swift

    func additionalActionTitle() -> String?
  • Undocumented

    Default Implementation

    Undocumented

    Declaration

    Swift

    func triggerAdditional(presenter: UIViewController, completion: @escaping (Bool) -> Void)
  • allowLocationInfoButton Default implementation

    Undocumented

    Default Implementation

    Undocumented

    Declaration

    Swift

    var allowLocationInfoButton: Bool { get }