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
allowsFeedbackUIAllow to show feedback related UI
categoryDataProviderCustom dataProvider to change Categories elements
locationProviderlocation provider for both SearchEngine and Discover SearchEngine.
DefaultLocationProviderused as default value.hideCategorySlotsHide horizontal set of category buttons (aka hot category buttons or category slots)
styleStyle to be used for Search UI elements.
distanceFormatterFormatter for distance.
-
Allow to show feedback related UI
Declaration
Swift
public var allowsFeedbackUI: Bool -
Custom dataProvider to change Categories elements
DefaultCategoryDataProviderused by default. SDK providesConstantCategoryDataProviderto pass constant custom categoriesDeclaration
Swift
public var categoryDataProvider: CategoryDataProvider -
Force to use your own location provider instead of
DefaultLocationProviderDeclaration
Swift
public var locationProvider: LocationProvider? -
Hide horizontal set of category buttons (aka hot category buttons or category slots)
Use
CategoryDataProvider.categorySlotsto 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
MKDistanceFormatterbehavior used bySearchSuggestionCellto display search results in a specific unit system. A nil value will use theMKDistanceFormattersystem behavior to infer the unit system based on the device locale.Declaration
Swift
public var distanceFormatter: MKDistanceFormatter?
Configuration Structure Reference