TKAutocompleting

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

    Declaration

    Swift

    func autocomplete(_ input: String, near mapRect: MKMapRect) -> Single<[TKAutocompletionResult]>

    Parameters

    input

    Query fragment typed by user

    mapRect

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

    Return Value

    Autocompletion results for query fragment. Should fire with empty result or error out if nothing found. Needs to complete.

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

    Declaration

    Swift

    func annotation(for result: TKAutocompletionResult) -> Single<MKAnnotation>

    Parameters

    result

    The result for which to fetch the annotation

    Return Value

    Single-observable with the annotation for the result. Can error out if an unknown result was passed in.

  • 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?
  • triggerAdditional(presenter:) Default implementation

    Default Implementation

    Declaration

    Swift

    func triggerAdditional(presenter: UIViewController) -> Single<Bool>