VisualInstructionDelegate

public protocol VisualInstructionDelegate : AnyObject, UnimplementedLogging

The VisualInstructionDelegate protocol defines a method that allows an object to customize presented visual instructions.

  • label(_:willPresent:as:) Default implementation

    Called when an InstructionLabel will present a visual instruction.

    Default Implementation

    UnimplementedLogging prints a warning to standard output the first time this method is called.

    Declaration

    Swift

    func label(_ label: InstructionLabel,
               willPresent instruction: VisualInstruction,
               as presented: NSAttributedString) -> NSAttributedString?

    Parameters

    label

    The label that the instruction will be presented on.

    instruction

    The VisualInstruction that will be presented.

    presented

    The formatted string that is provided by the instruction presenter

    Return Value

    Optionally, a customized NSAttributedString that will be presented instead of the default, or if nil, the default behavior will be used.