Declaration
compose().presentationDragIndicator(
visibility: SwiftUI.Visibility
)nonisolated func presentationDragIndicator(
_ visibility: Visibility
) -> some ViewParameters
visibility*SwiftUI.VisibilityThe preferred visibility of the drag indicator.
Discussion
You can show a drag indicator when it isn't apparent that a sheet can resize or when the sheet can't dismiss interactively.
struct ContentView: View {
@State private var showSettings = false
var body: some View {
Button("View Settings") {
showSettings = true
}
.sheet(isPresented: $showSettings) {
SettingsView()
.presentationDetents([.medium, .large])
.presentationDragIndicator(.visible)
}
}
}See also
More in Gestures and input.
- defaultHoverEffectSets the default hover effect to use for views within this view.
- defersSystemGesturesSets the screen edge from which you want your gesture to take precedence over the system gesture.
- dragConfigurationConfigures a drag session.
- dragContainerA container with draggable views. The drag payload is identifiable. To form the payload, use the identifier of the dragged view inside the container.
- dragContainerSelectionProvides multiple item selection support for drag containers.
- gestureAttaches a gesture to the view with a lower precedence than gestures defined by the view.
- handGestureShortcutAssigns a hand gesture shortcut to the modified control.
- highPriorityGestureAttaches a gesture to the view with a higher precedence than gestures defined by the view.
- hoverEffectApplies a hover effect to this view.
- hoverEffectDisabledAdds a condition that controls whether this view can display hover effects.
- simultaneousGestureAttaches a gesture to the view to process simultaneously with gestures defined by the view.