Contents

init(_:isPresented:arrowEdge:anchorID:action:)

Creates a tip view with an optional arrow.

Declaration

@MainActor @preconcurrency init<AnchorID>(_ tip: (any Tip)?, isPresented: Binding<Bool>? = nil, arrowEdge: Edge? = nil, anchorID: AnchorID, action: @escaping @MainActor @Sendable (Tips.Action) -> Void = { _ in }) where Content == AnyTip, AnchorID : Hashable, AnchorID : Sendable

Parameters

  • tip:

    The tip to display.

  • isPresented:

    A binding that will automatically update to true when a tip is displayed. This value can be changed to temporarily hide or show a currently displayable tip. If this value is nil, the view will automatically disappear based on the tip’s status and display rules.

  • arrowEdge:

    The edge of the tip view that displays the arrow.

  • anchorID:

    The identifier used to read the .bounds of the anchoring view.

  • action:

    The closure to perform when the user triggers a tip’s action.

Discussion

Use a TipView when you want to indicate the UI element to which the tip applies, but don’t want to directly anchor the tip view to that element. Use the popoverTip(_:arrowEdge:action:) to anchor your tip to an element.

See Also

Creating a tip view