<!DOCTYPE html> <html lang="en"> <head> <title>GIFAnimatable Protocol Reference</title> <link rel="stylesheet" type="text/css" href="../css/jazzy.css" /> <link rel="stylesheet" type="text/css" href="../css/highlight.css" /> <meta charset='utf-8'> <script src="../js/jquery.min.js" defer></script> <script src="../js/jazzy.js" defer></script> </head> <body> <a name="//apple_ref/swift/Protocol/GIFAnimatable" class="dashAnchor"></a> <a title="GIFAnimatable Protocol Reference"></a> <header> <div class="content-wrapper"> <p><a href="../index.html">Gifu Docs</a> (100% documented)</p> <p class="header-right"><a href="https://github.com/kaishin/gifu/"><img src="../img/gh.png"/>View on GitHub</a></p> <p class="header-right"><a href="dash-feed://https%3A%2F%2Fkaishin%2Egithub%2Eio%2Fdocsets%2FGifu%2Exml"><img src="../img/dash.png"/>Install in Dash</a></p> </div> </header> <div class="content-wrapper"> <p id="breadcrumbs"> <a href="../index.html">Gifu Reference</a> <img id="carat" src="../img/carat.png" /> GIFAnimatable Protocol Reference </p> </div> <div class="content-wrapper"> <nav class="sidebar"> <ul class="nav-groups"> <li class="nav-group-name"> <a href="../Classes.html">Classes</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../Classes/Animator.html">Animator</a> </li> <li class="nav-group-task"> <a href="../Classes/GIFImageView.html">GIFImageView</a> </li> </ul> </li> <li class="nav-group-name"> <a href="../Protocols.html">Protocols</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../Protocols/GIFAnimatable.html">GIFAnimatable</a> </li> <li class="nav-group-task"> <a href="../Protocols/ImageContainer.html">ImageContainer</a> </li> </ul> </li> </ul> </nav> <article class="main-content"> <section> <section class="section"> <h1>GIFAnimatable</h1> <div class="declaration"> <div class="language"> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">GIFAnimatable</span><span class="p">:</span> <span class="kd">class</span></code></pre> </div> </div> <p>The protocol that view classes need to conform to to enable animated GIF support.</p> </section> <section class="section task-group-section"> <div class="task-group"> <ul> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatableP8animatorAA8AnimatorCSgv"></a> <a name="//apple_ref/swift/Property/animator" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatableP8animatorAA8AnimatorCSgv">animator</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Responsible for managing the animation frames.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="k">var</span> <span class="nv">animator</span><span class="p">:</span> <span class="kt"><a href="../Classes/Animator.html">Animator</a></span><span class="p">?</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatableP5layerSo7CALayerCv"></a> <a name="//apple_ref/swift/Property/layer" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatableP5layerSo7CALayerCv">layer</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Notifies the instance that it needs display.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="k">var</span> <span class="nv">layer</span><span class="p">:</span> <span class="kt">CALayer</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatableP5frameSC6CGRectVv"></a> <a name="//apple_ref/swift/Property/frame" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatableP5frameSC6CGRectVv">frame</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>View frame used for resizing the frames.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="k">var</span> <span class="nv">frame</span><span class="p">:</span> <span class="kt">CGRect</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatableP11contentModeSC013UIViewContentD0Ov"></a> <a name="//apple_ref/swift/Property/contentMode" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatableP11contentModeSC013UIViewContentD0Ov">contentMode</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Content mode used for resizing the frames.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="k">var</span> <span class="nv">contentMode</span><span class="p">:</span> <span class="kt">UIViewContentMode</span></code></pre> </div> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <ul> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePA2aBRzAA14ImageContainerRzlE20intrinsicContentSizeSC6CGSizeVv"></a> <a name="//apple_ref/swift/Property/intrinsicContentSize" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePA2aBRzAA14ImageContainerRzlE20intrinsicContentSizeSC6CGSizeVv">intrinsicContentSize</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Returns the intrinsic content size based on the size of the image.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">intrinsicContentSize</span><span class="p">:</span> <span class="kt">CGSize</span></code></pre> </div> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <ul> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE15gifLoopDurationSdv"></a> <a name="//apple_ref/swift/Property/gifLoopDuration" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE15gifLoopDurationSdv">gifLoopDuration</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Total duration of one animation loop</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">gifLoopDuration</span><span class="p">:</span> <span class="kt">TimeInterval</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE11activeFrameSo7UIImageCSgv"></a> <a name="//apple_ref/swift/Property/activeFrame" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE11activeFrameSo7UIImageCSgv">activeFrame</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Returns the active frame if available.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">activeFrame</span><span class="p">:</span> <span class="kt">UIImage</span><span class="p">?</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE10frameCountSiv"></a> <a name="//apple_ref/swift/Property/frameCount" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE10frameCountSiv">frameCount</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Total frame count of the GIF.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">frameCount</span><span class="p">:</span> <span class="kt">Int</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE14isAnimatingGIFSbv"></a> <a name="//apple_ref/swift/Property/isAnimatingGIF" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE14isAnimatingGIFSbv">isAnimatingGIF</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Introspect whether the instance is animating.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isAnimatingGIF</span><span class="p">:</span> <span class="kt">Bool</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE7animateySS12withGIFNamed_Si9loopCountyycSg17completionHandlertF"></a> <a name="//apple_ref/swift/Method/animate(withGIFNamed:loopCount:completionHandler:)" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE7animateySS12withGIFNamed_Si9loopCountyycSg17completionHandlertF">animate(withGIFNamed:loopCount:completionHandler:)</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Prepare for animation and start animating immediately.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">animate</span><span class="p">(</span><span class="n">withGIFNamed</span> <span class="nv">imageName</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">loopCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">completionHandler</span><span class="p">:</span> <span class="p">(()</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre> </div> </div> <div> <h4>Parameters</h4> <table class="graybox"> <tbody> <tr> <td> <code> <em>imageName</em> </code> </td> <td> <div> <p>The file name of the GIF in the main bundle.</p> </div> </td> </tr> <tr> <td> <code> <em>loopCount</em> </code> </td> <td> <div> <p>Desired number of loops, <= 0 for infinite loop.</p> </div> </td> </tr> <tr> <td> <code> <em>completionHandler</em> </code> </td> <td> <div> <p>Completion callback function</p> </div> </td> </tr> </tbody> </table> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE7animatey10Foundation4DataV11withGIFData_Si9loopCountyycSg17completionHandlertF"></a> <a name="//apple_ref/swift/Method/animate(withGIFData:loopCount:completionHandler:)" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE7animatey10Foundation4DataV11withGIFData_Si9loopCountyycSg17completionHandlertF">animate(withGIFData:loopCount:completionHandler:)</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Prepare for animation and start animating immediately.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">animate</span><span class="p">(</span><span class="n">withGIFData</span> <span class="nv">imageData</span><span class="p">:</span> <span class="kt">Data</span><span class="p">,</span> <span class="nv">loopCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">completionHandler</span><span class="p">:</span> <span class="p">(()</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre> </div> </div> <div> <h4>Parameters</h4> <table class="graybox"> <tbody> <tr> <td> <code> <em>imageData</em> </code> </td> <td> <div> <p>GIF image data.</p> </div> </td> </tr> <tr> <td> <code> <em>loopCount</em> </code> </td> <td> <div> <p>Desired number of loops, <= 0 for infinite loop.</p> </div> </td> </tr> <tr> <td> <code> <em>completionHandler</em> </code> </td> <td> <div> <p>Completion callback function</p> </div> </td> </tr> </tbody> </table> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE7animatey10Foundation3URLV10withGIFURL_Si9loopCountyycSg17completionHandlertF"></a> <a name="//apple_ref/swift/Method/animate(withGIFURL:loopCount:completionHandler:)" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE7animatey10Foundation3URLV10withGIFURL_Si9loopCountyycSg17completionHandlertF">animate(withGIFURL:loopCount:completionHandler:)</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Prepare for animation and start animating immediately.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">animate</span><span class="p">(</span><span class="n">withGIFURL</span> <span class="nv">imageURL</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">loopCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">completionHandler</span><span class="p">:</span> <span class="p">(()</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre> </div> </div> <div> <h4>Parameters</h4> <table class="graybox"> <tbody> <tr> <td> <code> <em>imageURL</em> </code> </td> <td> <div> <p>GIF image url.</p> </div> </td> </tr> <tr> <td> <code> <em>loopCount</em> </code> </td> <td> <div> <p>Desired number of loops, <= 0 for infinite loop.</p> </div> </td> </tr> <tr> <td> <code> <em>completionHandler</em> </code> </td> <td> <div> <p>Completion callback function</p> </div> </td> </tr> </tbody> </table> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationySS12withGIFNamed_Si9loopCountyycSg17completionHandlertF"></a> <a name="//apple_ref/swift/Method/prepareForAnimation(withGIFNamed:loopCount:completionHandler:)" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationySS12withGIFNamed_Si9loopCountyycSg17completionHandlertF">prepareForAnimation(withGIFNamed:loopCount:completionHandler:)</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Prepares the animator instance for animation.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">prepareForAnimation</span><span class="p">(</span><span class="n">withGIFNamed</span> <span class="nv">imageName</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">loopCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">completionHandler</span><span class="p">:</span> <span class="p">(()</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre> </div> </div> <div> <h4>Parameters</h4> <table class="graybox"> <tbody> <tr> <td> <code> <em>imageName</em> </code> </td> <td> <div> <p>The file name of the GIF in the main bundle.</p> </div> </td> </tr> <tr> <td> <code> <em>loopCount</em> </code> </td> <td> <div> <p>Desired number of loops, <= 0 for infinite loop.</p> </div> </td> </tr> </tbody> </table> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationy10Foundation4DataV11withGIFData_Si9loopCountyycSg17completionHandlertF"></a> <a name="//apple_ref/swift/Method/prepareForAnimation(withGIFData:loopCount:completionHandler:)" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationy10Foundation4DataV11withGIFData_Si9loopCountyycSg17completionHandlertF">prepareForAnimation(withGIFData:loopCount:completionHandler:)</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Prepare for animation and start animating immediately.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">prepareForAnimation</span><span class="p">(</span><span class="n">withGIFData</span> <span class="nv">imageData</span><span class="p">:</span> <span class="kt">Data</span><span class="p">,</span> <span class="nv">loopCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">completionHandler</span><span class="p">:</span> <span class="p">(()</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre> </div> </div> <div> <h4>Parameters</h4> <table class="graybox"> <tbody> <tr> <td> <code> <em>imageData</em> </code> </td> <td> <div> <p>GIF image data.</p> </div> </td> </tr> <tr> <td> <code> <em>loopCount</em> </code> </td> <td> <div> <p>Desired number of loops, <= 0 for infinite loop.</p> </div> </td> </tr> </tbody> </table> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationy10Foundation3URLV10withGIFURL_Si9loopCountyycSg17completionHandlertF"></a> <a name="//apple_ref/swift/Method/prepareForAnimation(withGIFURL:loopCount:completionHandler:)" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationy10Foundation3URLV10withGIFURL_Si9loopCountyycSg17completionHandlertF">prepareForAnimation(withGIFURL:loopCount:completionHandler:)</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Prepare for animation and start animating immediately.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">prepareForAnimation</span><span class="p">(</span><span class="n">withGIFURL</span> <span class="nv">imageURL</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">loopCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">completionHandler</span><span class="p">:</span> <span class="p">(()</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre> </div> </div> <div> <h4>Parameters</h4> <table class="graybox"> <tbody> <tr> <td> <code> <em>imageURL</em> </code> </td> <td> <div> <p>GIF image url.</p> </div> </td> </tr> <tr> <td> <code> <em>loopCount</em> </code> </td> <td> <div> <p>Desired number of loops, <= 0 for infinite loop.</p> </div> </td> </tr> </tbody> </table> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE15prepareForReuseyyF"></a> <a name="//apple_ref/swift/Method/prepareForReuse()" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE15prepareForReuseyyF">prepareForReuse()</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Stop animating and free up GIF data from memory.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">prepareForReuse</span><span class="p">()</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE17startAnimatingGIFyyF"></a> <a name="//apple_ref/swift/Method/startAnimatingGIF()" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE17startAnimatingGIFyyF">startAnimatingGIF()</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Start animating GIF.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">startAnimatingGIF</span><span class="p">()</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE16stopAnimatingGIFyyF"></a> <a name="//apple_ref/swift/Method/stopAnimatingGIF()" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE16stopAnimatingGIFyyF">stopAnimatingGIF()</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Stop animating GIF.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">stopAnimatingGIF</span><span class="p">()</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE21setShouldResizeFramesySbF"></a> <a name="//apple_ref/swift/Method/setShouldResizeFrames(_:)" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE21setShouldResizeFramesySbF">setShouldResizeFrames(_:)</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Whether the frame images should be resized or not. The default is <code>false</code>, which means that the frame images retain their original size.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">setShouldResizeFrames</span><span class="p">(</span><span class="n">_</span> <span class="nv">resize</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span></code></pre> </div> </div> <div> <h4>Parameters</h4> <table class="graybox"> <tbody> <tr> <td> <code> <em>resize</em> </code> </td> <td> <div> <p>Boolean value indicating whether individual frames should be resized.</p> </div> </td> </tr> </tbody> </table> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE19setFrameBufferCountySiF"></a> <a name="//apple_ref/swift/Method/setFrameBufferCount(_:)" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE19setFrameBufferCountySiF">setFrameBufferCount(_:)</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Sets the number of frames that should be buffered. Default is 50. A high number will result in more memory usage and less CPU load, and vice versa.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">setFrameBufferCount</span><span class="p">(</span><span class="n">_</span> <span class="nv">frames</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre> </div> </div> <div> <h4>Parameters</h4> <table class="graybox"> <tbody> <tr> <td> <code> <em>frames</em> </code> </td> <td> <div> <p>The number of frames to buffer.</p> </div> </td> </tr> </tbody> </table> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:4Gifu13GIFAnimatablePAAE19updateImageIfNeededyyF"></a> <a name="//apple_ref/swift/Method/updateImageIfNeeded()" class="dashAnchor"></a> <a class="token" href="#/s:4Gifu13GIFAnimatablePAAE19updateImageIfNeededyyF">updateImageIfNeeded()</a> </code> <span class="declaration-note"> Extension method </span> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Updates the image with a new frame if necessary.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">updateImageIfNeeded</span><span class="p">()</span></code></pre> </div> </div> </section> </div> </li> </ul> </div> </section> </section> <section id="footer"> <p>2018 © Reda Lemeden. See LICENSE for more details.</p> <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p> </section> </article> </div> </body> </div> </html>