StyleContainer

public struct StyleContainer
extension StyleContainer: Equatable

Holder struct for main and dark version of the style definition. If darkStyle is not provided, setting TomTomMap.styleMode has no effect.

  • Creates an instance that only provides a main style.

    Declaration

    Swift

    public init(mainStyle: StyleDefinition)

    Parameters

    mainStyle

    Main style used by the map.

  • Creates an instance with main and dark versions of the map style.

    Declaration

    Swift

    public init(mainStyle: StyleDefinition, darkStyle: StyleDefinition)

    Parameters

    mainStyle

    main style used by the map.

    darkStyle

    dark style used by the map.

  • Creates an instance with main and dark versions of the map style.

    Attention

    Fonts need to be provided via the main application bundle.

    • mainStyle: main style used by the map.
    • darkStyle: dark style used by the map.
    • bundle: bundle with resources (style files, sprites) and assets.

    Declaration

    Swift

    public init(mainStyle: StyleDefinition, darkStyle: StyleDefinition, bundle: Bundle)

    Parameters

    mainStyle

    main style used by the map.

    darkStyle

    dark style used by the map.

    bundle

    bundle with resources (style files, sprites) and assets.

  • Defines a container containing a default light style and a default dark style.

    Declaration

    Swift

    public static let defaultStyle: StyleContainer
  • Defines a container containing a standard light driving style and a standard dark driving style.

    Declaration

    Swift

    public static let drivingStyle: StyleContainer
  • Defines a container with default vehicle restrictions in light and dark styles.

    Declaration

    Swift

    public static let restrictionsStyle: StyleContainer
  • Defines a container containing a satellite imagery style.

    Declaration

    Swift

    public static let satelliteStyle: StyleContainer
  • An operation to compare two instances of StyleContainer. The comparison happens by comparing the mainStyle and darkStyle of each instance. If both are matching the others’, this operation returns true.

    Declaration

    Swift

    public static func == (lhs: StyleContainer, rhs: StyleContainer) -> Bool

    Parameters

    lhs

    A StyleContainer to compare.

    rhs

    Another StyleContainer to compare.

    Return Value

    a Boolean value indicating the equality of two instances of StyleContainer.