init(_:variableValue:bundle:)
Creates a labeled image that you can use as content for controls, with a variable value.
Declaration
init(_ name: String, variableValue: Double?, bundle: Bundle? = nil)Parameters
- name:
The name of the image resource to lookup, as well as the localization key with which to label the image.
- variableValue:
An optional value between
0.0and1.0that 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 and localization content. If
nil, SwiftUI uses the mainBundle. Defaults tonil.
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.