title: How to add GIF animations or .gif files to CALayer while composing AVPlayerVideo using AVVideoCompositionCoreAnimationTool?
body: <p>I am able to set <code>UIImage</code> type as contents to <code>CALayer</code> reference by using</p>
  <pre><code>[overlayLayer setContents:(id)[posterImage CGImage]]
  </code></pre>
  <p>and then able to add some basic animation to the layer like rotation and opacity.</p>
  <p><strong>But my requirement is to add Gif Image View with animation to parentLayer CALayer?</strong></p>
  <p>I used <a href="https://github.com/Flipboard/FLAnimatedImage" rel="nofollow noreferrer">https://github.com/Flipboard/FLAnimatedImage</a> to play gif files.</p>
  <p><strong>But i am struck while setting this GiF image view as contents of CALayer.</strong></p>
  <p>I if try to add sublayer of this Gif Image View like</p>
  <pre><code>[parentLayer addSublayer:gifImageView.layer];
  </code></pre>
  <p>i am able to set layer but App crashes at <code>[self.layer setNeedsDisplay];</code> of <code>FLAnimated</code> View class</p>
  <p>The ideas which you share might help me.
  Thank You</p>