---
title: "init(transferable:in:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/attributedstring/init(transferable:in:)"
---

# init(transferable:in:)

Extract an attributed string from SwiftUI’s transferable representation in a certain environment.

## Declaration

```swift
init(transferable: AttributedTextFormatting.Transferable, in environment: EnvironmentValues) throws
```

## Discussion

Discussion Use this initializer with a AttributedTextFormatting/Transferable that was imported, e.g. in the action closure of the View/dropDestination(for:action:isTargeted) modifier. note: This initializer applies the AttributedTextFormattingDefinition in the given environment to the imported text before returning. note: View/attributedTextFormattingDefinition(_:)-uc57, AttributedTextValueConstraint/constrain(_:)-6cp64
