ValueAssistantGroup

@MainActor
public final class ValueAssistantGroup<TargetType> : ValueAssistant where TargetType : AnyObject

The ValueAssistantGroup class enables multiple ValueAssistant objects to be attached to a single motion class.

  • Declaration

    Swift

    @MainActor
    public var isAdditive: Bool { get set }
  • Declaration

    Swift

    @MainActor
    public var additiveWeighting: Double { get set }
  • Updates the additive state of all child ValueAssistant objects in this group.

    Declaration

    Swift

    @MainActor
    public func updateAdditive(isAdditive: Bool)

    Parameters

    isAdditive

    The new additive state to assign.

  • An array of ValueAssistant objects that this group manages.

    Declaration

    Swift

    @MainActor
    private(set) public var assistants: [any ValueAssistant<TargetType>] { get }
  • Initializer.

    Declaration

    Swift

    @MainActor
    public init(assistants: [any ValueAssistant<TargetType>]? = [])

    Parameters

    assistants

    An optional array of ValueAssistant objects to which the ValueAssistantGroup should delegate ValueAssistant method calls.

Public Methods

  • Adds a ValueAssistant to the group.

    Note

    The added assistant will be assigned the same values for additive and additiveWeighting as this group’s values.

    Seealso

    additive, additiveWeighting

    Declaration

    Swift

    @MainActor
    public func add(_ assistant: any ValueAssistant<TargetType>)

    Parameters

    assistant

    A ValueAssistant object.

ValueAssistant methods