VisualInstruction
extension VisualInstruction
-
Returns a
CPImageSetrepresenting the maneuver.Declaration
Swift
public func maneuverImageSet(side: DrivingSide) -> CPImageSet?Parameters
sideDriving side of the road cars and traffic flow.
Return Value
An image set with light and dark versions of an image.
-
Returns whether the
VisualInstruction’s maneuver image should be flipped according to the driving side.Declaration
Swift
public func shouldFlipImage(side: DrivingSide) -> Bool -
carPlayManeuverLabelAttributedText(bounds:shieldHeight:window:traitCollection:instructionLabelType:)Glanceable instruction given the available space, appearance styling, and attachments.
Declaration
Swift
public func carPlayManeuverLabelAttributedText<T: InstructionLabel>(bounds: @escaping () -> (CGRect), shieldHeight: CGFloat, window: UIWindow?, traitCollection: UITraitCollection? = nil, instructionLabelType: T.Type? = nil) -> NSAttributedString?Parameters
boundsA closure that calculates the available bounds for the maneuver text.
shieldHeightThe height of the shield.
windowA
UIWindowthat holds theUIAppearancestyling properties, preferably the CarPlay window.traitCollectionCustom
UITraitCollectionthat is used to control color of the shield icons depending on various custom situations when actual trait collection is different (e.g. when driving through the tunnel).instructionLabelTypeType, which is inherited from
InstructionLabeland will be used for showing a visual instruction.Return Value
An
NSAttributedStringwith maneuver instructions. -
Returns a
CPImageSetrepresenting the maneuver lane configuration.Declaration
Swift
public func lanesImageSet(side: DrivingSide, direction: ManeuverDirection?, scale: CGFloat) -> CPImageSet?Parameters
sideIndicates which side of the road cars and traffic flow.
directionManeuverTypethat contains directional information.scaleThe natural scale factor associated with the CarPlay screen.
Return Value
Light and dark representations of an image that contains maneuver lane configuration.
Install in Dash
VisualInstruction Extension Reference