Style

public struct Style

Color-class based structure to generate your own UI style for Search UI elements. Instead of color-per-element you can configure color classes like primaryTextColor or primaryAccentColor

Dark mode support should be implemented in the same Style instance as the light one. Please use Asset Catalog colors or UIColor.init(dynamicProvider:)

  • Make your own Style for SearchUI or use the default as Style.default. Pass nil to args to use default value

    Declaration

    Swift

    public init(
        primaryTextColor: UIColor? = nil,
        primaryBackgroundColor: UIColor? = nil,
        secondaryBackgroundColor: UIColor? = nil,
        separatorColor: UIColor? = nil,
        primaryAccentColor: UIColor? = nil,
        primaryInactiveElementColor: UIColor? = nil,
        panelShadowColor: UIColor? = nil,
        panelHandlerColor: UIColor? = nil,
        iconTintColor: UIColor? = nil,
        activeSegmentTitleColor: UIColor? = nil
    )

    Parameters

    primaryTextColor

    Color of the most text-based elements

    primaryBackgroundColor

    Main background color

    secondaryBackgroundColor

    Search Bar background, Category buttons background

    separatorColor

    Separator color for UITableViews

    primaryAccentColor

    Accent color is used is UIView.tintColor. By default is blue (mapbox style)

    primaryInactiveElementColor

    Color of non-active or non-important labels like placeholder in SearchBar or address label in SearchSuggestionCell

    panelShadowColor

    Shadow color for MapboxPanelController

    panelHandlerColor

    Color of the small rectangle at the top of the MapboxPanelController

    iconTintColor

    Tinting color for most icons like category icon or favorite record icon

    activeSegmentTitleColor

    Title color for active element in SegmentedControl

  • Default Mapbox style for SearchUI SDK

    Declaration

    Swift

    public static let `default`: Style
  • Color of the most text-based elements

    Declaration

    Swift

    public var primaryTextColor: UIColor
  • Main background color

    Declaration

    Swift

    public var primaryBackgroundColor: UIColor
  • Search Bar background, Category buttons background

    Declaration

    Swift

    public var secondaryBackgroundColor: UIColor
  • Separator color for UITableViews

    Declaration

    Swift

    public var separatorColor: UIColor
  • Accent color is used is UIView.tintColor. By default is blue (mapbox style)

    Declaration

    Swift

    public var primaryAccentColor: UIColor
  • Color of non-active or non-important labels like placeholder in SearchBar or address label in SearchSuggestionCell

    Declaration

    Swift

    public var primaryInactiveElementColor: UIColor
  • Shadow color for MapboxPanelController

    Declaration

    Swift

    public var panelShadowColor: UIColor
  • Color of the small rectangle at the top of the MapboxPanelController

    Declaration

    Swift

    public var panelHandlerColor: UIColor
  • Tinting color for most icons like category icon or favorite record icon

    Declaration

    Swift

    public var iconTintColor: UIColor
  • Title color for active element in SegmentedControl

    Note

    To customise inactive title color use Style.primaryInactiveElementColor

    Declaration

    Swift

    public var activeSegmentTitleColor: UIColor