SpeedLimitViewModel
public final class SpeedLimitViewModel : ObservableObject, Equatable
A view model that represents the speed limit information.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Initializes a new instance of
SpeedLimitViewModelwith a speed threshold.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public init(speedThreshold: Measurement<UnitSpeed>)Parameters
speedThresholdThe speed threshold for the view model.
-
Initializes a new instance of
SpeedLimitViewModelwith speed, optional speed limit, and speed threshold.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public init( speed: Measurement<UnitSpeed>, speedLimit: Measurement<UnitSpeed>? = nil, speedThreshold: Measurement<UnitSpeed> )Parameters
speedThe current speed.
speedLimitThe optional speed limit.
speedThresholdThe speed threshold for the view model.
-
Initializes a new instance of
SpeedLimitViewModelwith speed, optional speed limit, speed threshold, and speed unit.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public init( speed: Measurement<UnitSpeed>, speedLimit: Measurement<UnitSpeed>? = nil, speedThreshold: Measurement<UnitSpeed>, speedUnit: UnitSpeed )Parameters
speedThe current speed.
speedLimitThe optional speed limit.
speedThresholdThe speed threshold for the view model.
speedUnitThe unit of speed.
-
The current speed of the vehicle.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
@Published public var speed: Measurement<UnitSpeed> { get set } -
The optional speed limit for the vehicle.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
@Published public var speedLimit: Measurement<UnitSpeed>? { get set } -
A Boolean value indicating whether the speed limit is visible.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
@Published public var isVisible: Bool { get set } -
The unit of speed measurement.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
@Published public var speedUnit: UnitSpeed { get set } -
Compares two
SpeedLimitViewModelinstances for equality.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public static func == (lhs: SpeedLimitViewModel, rhs: SpeedLimitViewModel) -> BoolParameters
lhsThe left-hand side
SpeedLimitViewModelinstance.rhsThe right-hand side
SpeedLimitViewModelinstance.Return Value
A Boolean value indicating whether the two instances are equal.
-
Resets the speed, speed limit, and visibility to their default values.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func reset()
TomTom SDK for iOS (0.66.0)
SpeedLimitViewModel