HighlightsCalculator

public enum HighlightsCalculator

Helper to calculate matching ranges suitable for NSAttributedString attributes

  • Calculates ranges to highlight in SearchSuggestion name

    Declaration

    Swift

    public static func calculate(for query: String, in name: String) -> [NSRange]

    Parameters

    query

    search query

    name

    SearchSuggestion name

    Return Value

    list of ranges to highlight