---
title: "serialize(to:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlbinaryarchive/serialize(to:)"
---

# serialize(to:)

Writes the contents of the archive to a file.

## Declaration

```swift
func serialize(to url: URL) throws
```

## Parameters

- `url`: The URL for the destination file.

## Discussion

Discussion The destination folder needs to exist when you call this method.
