Contents

init(_:variableValue:bundle:label:)

Creates a labeled image that you can use as content for controls, with the specified label and variable value.

Declaration

init(_ name: String, variableValue: Double?, bundle: Bundle? = nil, label: Text)

Parameters

  • name:

    The name of the image resource to lookup.

  • variableValue:

    An optional value between 0.0 and 1.0 that the rendered image can use to customize its appearance, if specified. If the symbol doesn’t support variable values, this parameter has no effect.

  • bundle:

    The bundle to search for the image resource. If nil, SwiftUI uses the main Bundle. Defaults to nil.

  • label:

    The label associated with the image. SwiftUI uses the label for accessibility.

Discussion

This initializer creates an image using a using a symbol in the specified bundle. The rendered symbol may alter its appearance to represent the value provided in variableValue.

See Also

Creating an image for use as a control