Declaration
compose().help(textKey: string)@export(implementation) nonisolated func help(
_ textKey: LocalizedStringResource
) -> some View3 more Swift overloads share this form
nonisolated func help(_ textKey: LocalizedStringKey) -> some Viewnonisolated func help(_ text: Text) -> some Viewnonisolated func help<S>(
_ text: S
) -> some View
where S : StringProtocolParameters
textKey*stringText 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 doc://com.apple.documentation/design/human-interface-guidelines/offering-help in the Human Interface Guidelines.
Button(action: composeMessage) {
Image(systemName: "square.and.pencil")
}
.help("Compose a new message")See also
More in Input and interaction.
- allowsHitTestingConfigures whether this view participates in hit test operations.
- allowsWindowActivationEventsConfigures whether gestures in this view hierarchy can handle events that activate the containing window.
- buttonRepeatBehaviorSets whether buttons in this view should repeatedly trigger their actions on prolonged interactions.
- disabledAdds a condition that controls whether someone can interact with this view.
- handlesExternalEventsSpecifies the external events that the view's scene handles if the scene is already open.
- invalidatableContentMark the receiver as their content might be invalidated.
- keyboardShortcutAssigns a keyboard shortcut to the modified control.
- scrollClipDisabledSets whether a scroll view clips its content to its bounds.
- scrollDisabledDisables or enables scrolling in scrollable views.
- scrollDismissesKeyboardConfigures the behavior in which scrollable content interacts with the software keyboard.
- sensoryFeedbackPlays the specified feedback when the provided trigger value changes.
- userActivityAdvertises a user activity type.