---
title: "importableFromServices(for:action:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/importablefromservices(for:action:)"
---

# importableFromServices(for:action:)

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

## Declaration

```swift
nonisolated func importableFromServices<T>(for payloadType: T.Type = T.self, action: @escaping ([T]) -> Bool) -> some View where T : Transferable

```

## Parameters

- `payloadType`: The expected type of the imported models.
- `action`: A closure that will be called with the imported service item. Return false to indicate that there was a failure to receive the items.

## Discussion

Discussion @State private var title: String var body: some View {     Color.pink         .frame(width: 400, height: 400)         .importableFromServices(for: String.self) { titles             title = titles.first ?? title             return !titles.isEmpty         } }

## See Also

### Importing and exporting transferable items

- [exportableToServices(_:)](swiftui/view/exportabletoservices(_:).md)
- [exportableToServices(_:onEdit:)](swiftui/view/exportabletoservices(_:onedit:).md)
