init(_:image:isOn:)
Creates a toggle that generates its label from a localized string resource and image resource.
Declaration
@export(implementation) nonisolated init(_ titleResource: LocalizedStringResource, image: ImageResource, isOn: Binding<Bool>)Parameters
- titleResource:
Text resource for the toggle’s localized title, that describes the purpose of the toggle.
- image:
The name of the image resource to lookup.
- isOn:
A binding to a property that indicates whether the toggle is on or off.
Discussion
This initializer creates a Text view on your behalf. See Text for more information about localizing strings.