---
title: "writeHeader(to:fileType:options:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avmovie/writeheader(to:filetype:options:)"
---

# writeHeader(to:fileType:options:)

Writes the movie header to the specified URL.

## Declaration

```swift
func writeHeader(to URL: URL, fileType: AVFileType, options: AVMovieWritingOptions = []) throws
```

## Parameters

- `URL`: The URL indicating where to write the movie header.
- `fileType`: A UTI that indicates the specific file format for the movie header.
- `options`: The doc://com.apple.avfoundation/documentation/AVFoundation/AVMovieWritingOptions constants whose bits specify the options for writing the movie header.

## See Also

### Creating and writing headers

- [is(compatibleWithFileType:)](avfoundation/avmovie/is(compatiblewithfiletype:).md)
- [makeMovieHeader(fileType:)](avfoundation/avmovie/makemovieheader(filetype:).md)
- [AVMovieWritingOptions](avfoundation/avmoviewritingoptions.md)
