<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAssetWriterInput/canAddTrackAssociation(withTrackOf:type:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAssetWriterInput(im)canAddTrackAssociationWithTrackOfInput:type:"
  },
  "title" : "canAddTrackAssociation(withTrackOf:type:)"
}
-->

# canAddTrackAssociation(withTrackOf:type:)

Determines whether it’s valid to associate another input’s track with this input’s track.

```
func canAddTrackAssociation(withTrackOf input: AVAssetWriterInput, type trackAssociationType: String) -> Bool
```

## Parameters

`input`

An asset writer input that contains the track to associate.

`trackAssociationType`

The type of track association to test.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the system can make the association between tracks; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

This method returns <doc://com.apple.documentation/documentation/Swift/false> if the association type requires tracks of a media type that doesn’t match the input’s type, or if the output file type doesn’t support track associations.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)