---
title: "importsItemProviders(_:onImport:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/importsitemproviders(_:onimport:)"
---

# importsItemProviders(_:onImport:)

Enables importing item providers from services, such as Continuity Camera on macOS.

## Declaration

```swift
nonisolated func importsItemProviders(_ contentTypes: [UTType], onImport: @escaping ([NSItemProvider]) -> Bool) -> some View

```

## Parameters

- `contentTypes`: The types of content that the view supports importing. An empty array means the view does not currently support importing.
- `onImport`: A closure that will be called with the imported service item. Return false to indicate that there was a failure to receive the items.

## See Also

### Importing and exporting using item providers

- [exportsItemProviders(_:onExport:)](swiftui/view/exportsitemproviders(_:onexport:).md)
- [exportsItemProviders(_:onExport:onEdit:)](swiftui/view/exportsitemproviders(_:onexport:onedit:).md)
