---
title: "addTrackAssociation(to:type:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avmutablecompositiontrack/addtrackassociation(to:type:)"
---

# addTrackAssociation(to:type:)

Establishes a track association of a specific type between two tracks.

## Declaration

```swift
func addTrackAssociation(to compositionTrack: AVCompositionTrack, type trackAssociationType: AVAssetTrack.AssociationType)
```

## Parameters

- `compositionTrack`: A composition track to associate.
- `trackAssociationType`: The type of track association to create between tracks.

## See Also

### Associating tracks

- [removeTrackAssociation(to:type:)](avfoundation/avmutablecompositiontrack/removetrackassociation(to:type:).md)
