One Logo Pool Ball
SwiftUI · IOS API REFERENCE

DragConfiguration.OperationsWithinApp

struct · iOS 26.0+ · SDK 27.1

struct OperationsWithinApp

Describes the drag operations suggested to destinations within the app. To create a default configuration, initialize it without parameters. On iOS, the default behavior is to allow drag-to-copy within the application. On macOS, the default configuration is to support drag-to-copy to destinations both within the application and to other apps. In addition to `copy`, add `move` operation support by specifying that in the initializer: struct DraggableBookView: View { var id: UUID var body: some View { BookView() .draggable(Book(id: id)) .dragConfiguration(makeConfiguration()) } func makeConfiguration() -> DragConfiguration { let operations = OperationsWithinApp(allowMove: true) return DragConfiguration(operationsWithinApp: operations) } } In the example above, an application provides operations that will be suggested to destinations within the app. Drags to other apps will use the default behavior: suggest operation `copy` to drag destinations on macOS, and forbid drags on iOS.

Members (1)

init · iOS 26.0+

init

TypeScript
static init(allowMove?: boolean): DragConfiguration_OperationsWithinApp
Swift declaration
init(allowMove: Bool = false)

Creates a value that describes the operations allowed for drags that end within the application. Copy operation is always allowed.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUI types →