---
title: "importContents(from:)"
framework: usdkit
role: symbol
role_heading: Instance Method
path: "usdkit/usdlayer/importcontents(from:)-99hnf"
---

# importContents(from:)

Replaces the layer’s contents with the USDA string.

## Declaration

```swift
func importContents(from string: String) throws
```

## Parameters

- `string`: The USDA source to import.

## Discussion

Discussion note: An error if the string cannot be parsed.

## See Also

### Exporting and importing

- [export(to:)](usdkit/usdlayer/export(to:)-7vouy.md)
- [export(to:)](usdkit/usdlayer/export(to:)-5hboj.md)
- [importContents(from:)](usdkit/usdlayer/importcontents(from:)-2ipug.md)
