<!--
{
  "availability" : [
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/importableFromServices(for:action:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE22importableFromServices3for6actionQrqd__m_SbSayqd__Gct16CoreTransferable0J0Rd__lF"
  },
  "title" : "importableFromServices(for:action:)"
}
-->

# importableFromServices(for:action:)

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

```
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

```
@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
        }
}
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)