TriggeringConfigVariant
public struct TriggeringConfigVariant : Hashable, Equatable
Defines a variant for which a trigger should be generated.
The most vital part of the instance is the triggeringPoints
property where TriggerType
is the key, and TriggeringPoint
is the value associated with that key.
For example, the following variant will be applicable for a trigger where the road is controlled access, for all countries, for comprehensive mode, only for roundabout instructions, and it has one triggering point (follow).
TriggeringConfigVariant(
roadTypes: [.controlledAccess],
regions: [.restOfTheWorld],
announcementModes: [.comprehensive],
instructionTypes: [.roundabout],
triggeringPoints: [
.follow: TriggeringPoint(
recommendedDistance: TriggeringDistances(
defaultDistance: Measurement.tt.kilometers(1000.0)
),
messageDuration: 2
)
]
)
Important
This is a Public Preview API. It may be changed or removed at any time.-
Creates triggering variant.
Declaration
Swift
public init( roadTypes: Set<TriggeringRoadType>, regions: Set<TriggeringRegion>, announcementModes: Set<AnnouncementMode>, instructionTypes: Set<TriggeringInstructionType>, triggeringPoints: [TriggerType: TriggeringPoint] ) throws
Parameters
roadTypes
The roads for which the config variant is applicable.
regions
The regions for which the config variant is applicable.
announcementModes
The announcement modes for which the config variant is applicable.
instructionTypes
The instructions for which the config variant is applicable.
triggeringPoints
Triggering points define where the trigger of this variant must be exposed.
-
The roads for which the config variant is applicable.
Declaration
Swift
public let roadTypes: Set<TriggeringRoadType>
-
The regions for which the config variant is applicable.
Declaration
Swift
public let regions: Set<TriggeringRegion>
-
The announcement modes for which the config variant is applicable.
Declaration
Swift
public let announcementModes: Set<AnnouncementMode>
-
The instructions for which the config variant is applicable.
Declaration
Swift
public let instructionTypes: Set<TriggeringInstructionType>
-
Triggering points define where the trigger of this variant must be exposed.
Declaration
Swift
public let triggeringPoints: [TriggerType : TriggeringPoint]
-
Equality operator.
Declaration
Swift
public static func == (lhs: TriggeringConfigVariant, rhs: TriggeringConfigVariant) -> Bool
-
Hashing function.
Declaration
Swift
public func hash(into hasher: inout Hasher)