title: How to animate the string of a CATextLayer?
body: <p>I am currently overlaying some text in a video using the AVMutableComposition, I would like to change the string repeatedly based on some time interval. I am trying to use the Core Animation to achieve this; however, the string property does not seem to be animatable. Is there any other way to achieve the goal? Thanks. </p>
  
  <p>Code (not working):</p>
  
  <pre><code>func getSubtitlesAnimation(withFrames frames: [String], duration: CFTimeInterval)-&gt;CAKeyframeAnimation {
      let animation = CAKeyframeAnimation(keyPath:"string")
      animation.calculationMode = kCAAnimationDiscrete
      animation.duration = duration
      animation.values = frames
      animation.keyTimes = [0,0.5,1]
      animation.repeatCount = Float(frames.count)
      animation.isRemovedOnCompletion = false
      animation.fillMode = kCAFillModeForwards
      animation.beginTime = AVCoreAnimationBeginTimeAtZero
      return animation
  }
  </code></pre>