1

AVAsset has a tracks property...

var tracks: [AVAssetTrack] { get }

AVComposition inherits from AVAsset and also has a tracks property...

var tracks: [AVCompositionTrack] { get }

(AVCompositionTrack inherits from AVAssetTrack.)

Is AVComposition.tracks overriding AVAsset.tracks or is it hiding it?

Ian Warburton
  • 15,170
  • 23
  • 107
  • 189
  • 3
    Bear in mind none of those types are Swift types, they're all implemented in Obj-C. And in Obj-C [You can override a superclass property with a more specific type](https://stackoverflow.com/questions/5896085/how-to-override-a-superclass-property-with-more-specific-types). If these were pure Swift types, this wouldn't be possible. – Dávid Pásztor Feb 28 '20 at 17:19
  • So how have they got around the Swift compiler in this instance? – Ian Warburton Feb 28 '20 at 17:31
  • 2
    Because there is no Swift compiler involved. This is ObjC code. It's just an imported header in Swift. – Rob Napier Feb 28 '20 at 18:01

0 Answers0