Contents

help(_:)

Adds help text to a view using a localized string resource that you provide.

Declaration

@export(implementation) nonisolated func help(_ textKey: LocalizedStringResource) -> some View

Parameters

  • textKey:

    Text resource for the localized text to use as help.

Discussion

Adding help to a view configures the view’s accessibility hint and its help tag (also called a tooltip) in macOS or visionOS. For more information on using help tags, see Offering help in the Human Interface Guidelines.

Button(action: composeMessage) {
    Image(systemName: "square.and.pencil")
}
.help("Compose a new message")