---
title: "copy(_:)"
framework: packagedescription
role: symbol
role_heading: Type Method
path: "packagedescription/resource/copy(_:)"
---

# copy(_:)

Applies the copy rule to a resource at the given path.

## Declaration

```swift
static func copy(_ path: String) -> Resource
```

## Parameters

- `path`: The path for a resource.

## Return Value

Return Value A Resource instance.

## Discussion

Discussion If possible, use process(_:localization:) and automatically apply optimizations to resources. If your resources must remain untouched or must retain a specific folder structure, use the copy rule. It copies resources at the given path, as is, to the top level in the package’s resource bundle. If the given path represents a directory, Swift Package Manager preserves its structure.

## See Also

### Applying Rules

- [process(_:localization:)](packagedescription/resource/process(_:localization:).md)
- [Resource.Localization](packagedescription/resource/localization.md)
- [embedInCode(_:)](packagedescription/resource/embedincode(_:).md)
