Configuration
public struct Configuration
General structure to configure MapboxSearchController UI and logic
-
init(allowsFeedbackUI:categoryDataProvider:locationProvider:hideCategorySlots:style:distanceFormatter:)
Default configuration of MapboxSearchController.
Declaration
Swift
public init( allowsFeedbackUI: Bool = true, categoryDataProvider: CategoryDataProvider = DefaultCategoryDataProvider(), locationProvider: LocationProvider? = DefaultLocationProvider(), hideCategorySlots: Bool = false, style: Style = .default, distanceFormatter: MKDistanceFormatter? = nil )
Parameters
allowsFeedbackUI
Allow to show feedback related UI
categoryDataProvider
Custom dataProvider to change Categories elements
locationProvider
location provider for both SearchEngine and Discover SearchEngine. DefaultLocationProvider used as default value.
hideCategorySlots
Hide horizontal set of category buttons (aka hot category buttons or category slots)
style
Style to be used for Search UI elements.
-
Allow to show feedback related UI
Declaration
Swift
public var allowsFeedbackUI: Bool
-
Custom dataProvider to change Categories elements
DefaultCategoryDataProvider
used by default. SDK providesConstantCategoryDataProvider
to pass constant custom categoriesDeclaration
Swift
public var categoryDataProvider: CategoryDataProvider
-
Force to use your own location provider instead of
DefaultLocationProvider
Declaration
Swift
public var locationProvider: LocationProvider?
-
Hide horizontal set of category buttons (aka hot category buttons or category slots)
Use
CategoryDataProvider.categorySlots
to provide custom categoriesDeclaration
Swift
public var hideCategorySlots: Bool
-
Style to be used for Search UI elements. It’s possible to change style on the fly. Non-animatable.
Declaration
Swift
public var style: Style
-
Override the default
MKDistanceFormatter
behavior used bySearchSuggestionCell
to display search results in a specific unit system. A nil value will use theMKDistanceFormatter
system behavior to infer the unit system based on the device locale.Declaration
Swift
public var distanceFormatter: MKDistanceFormatter?