---
title: "track(withTrackID:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avmutablecomposition/track(withtrackid:)"
---

# track(withTrackID:)

Returns a track that contains the specified identifier.

## Declaration

```swift
func track(withTrackID trackID: CMPersistentTrackID) -> AVMutableCompositionTrack?
```

## Parameters

- `trackID`: The persistent track identifier.

## Return Value

Return Value A composition track or nil if no track is available.

## Discussion

Discussion Apple discourages using this method. Load a track asynchronously using loadTrack(withTrackID:completionHandler:) instead.

## See Also

### Accessing tracks

- [tracks](avfoundation/avmutablecomposition/tracks.md)
- [tracks(withMediaType:)](avfoundation/avmutablecomposition/tracks(withmediatype:).md)
- [tracks(withMediaCharacteristic:)](avfoundation/avmutablecomposition/tracks(withmediacharacteristic:).md)
