Initializer
init(_:tableName:bundle:icon:size:action:)
Creates a link with a localized text and optional icon, looking up the key in the given bundle.
- iOS 15.0+
- macOS 13.0+
- tvOS 16.0+
- visionOS 1.0+
- watchOS 11.0+
@MainActor init(_ key: LocalizedStringKey, tableName: String? = nil, bundle: Bundle = .main, icon: Image? = nil, size: OUDSLink.Size = .default, action: @escaping () -> Void)
Parameters
- key
A LocalizedStringKey used to look up the text in the given bundle
- tableName
The name of the .strings file, or nil for the default
- bundle
The bundle in which to look up the localized string. Defaults to Bundle.main.
- icon
Icon displayed in the link
- size
Size of the link
- action
The action to perform when the user triggers the link
Discussion
OUDSLink(LocalizedStringKey("feedback_link"), bundle: Bundle.module, size: .default) { }