Repository: airbnb/lottie-ios
File: Sources/Private/Experimental/ExperimentalAnimationLayer.swift (Swift)

Code before:
    super.init(layer: typedLayer)
  }

  required init?(coder _: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }

  // MARK: Internal

  /// Timing-related configuration to apply to this layer's child `CAAnimation`s
  ///  - This is effectively a configurable subset of `CAMediaTiming`
  struct CAMediaTimingConfiguration: Equatable {
    var autoreverses = false
    var repeatCount: Float = 0
    var speed: Float = 1
    var timeOffset: TimeInterval = 0
  }

  /// The `AnimationImageProvider` that `ImageLayer`s use to retrieve images,
  /// referenced by name in the animation json.
  var imageProvider: AnimationImageProvider

  /// The `FontProvider` that `TextLayer`s use to retrieve the `CTFont`
  /// that they should use to render their text content
  var fontProvider: AnimationFontProvider

  /// Sets up `CAAnimation`s for each `AnimationLayer` in the layer hierarchy,
  /// playing from `currentFrame`.
  func setupAnimation(
    context: AnimationContext,
    timingConfiguration: CAMediaTimingConfiguration)
  {
    // Remove any existing animations from the layer hierarchy
    removeAnimations()

    playbackState = .playing

    currentAnimationConfiguration = AnimationConfiguration(
      animationContext: context,
      timingConfiguration: timingConfiguration)

    let layerContext = LayerAnimationContext(
      animation: animation,
      timingConfiguration: timingConfiguration,
      startFrame: context.playFrom,
      endFrame: context.playTo,
      valueProviderStore: valueProviderStore,
      currentKeypath: AnimationKeypath(keys: []))

    // Perform a layout pass if necessary so all of the sublayers
    // have the most up-to-date sizing information

Review comment (suggestion):
```suggestion
  /// that they should use to render their text content.
```

Code after:
    super.init(layer: typedLayer)
  }

  required init?(coder _: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }

  // MARK: Internal

  /// Timing-related configuration to apply to this layer's child `CAAnimation`s
  ///  - This is effectively a configurable subset of `CAMediaTiming`
  struct CAMediaTimingConfiguration: Equatable {
    var autoreverses = false
    var repeatCount: Float = 0
    var speed: Float = 1
    var timeOffset: TimeInterval = 0
  }

  /// The `AnimationImageProvider` that `ImageLayer`s use to retrieve images,
  /// referenced by name in the animation json.
  var imageProvider: AnimationImageProvider {
    didSet { reloadImages() }
  }

  /// The `FontProvider` that `TextLayer`s use to retrieve the `CTFont`
  /// that they should use to render their text content
  var fontProvider: AnimationFontProvider {
    didSet { reloadFonts() }
  }

  /// Sets up `CAAnimation`s for each `AnimationLayer` in the layer hierarchy,
  /// playing from `currentFrame`.
  func setupAnimation(
    context: AnimationContext,
    timingConfiguration: CAMediaTimingConfiguration)
  {
    // Remove any existing animations from the layer hierarchy
    removeAnimations()

    playbackState = .playing

    currentAnimationConfiguration = AnimationConfiguration(
      animationContext: context,
      timingConfiguration: timingConfiguration)

    let layerContext = LayerAnimationContext(
      animation: animation,
      timingConfiguration: timingConfiguration,
      startFrame: context.playFrom,
      endFrame: context.playTo,
      valueProviderStore: valueProviderStore,