2016-10-02 23:33:56 +00:00
<!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%2Fpyroh%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 >
2016-10-08 17:36:32 +00:00
< li class = "nav-group-task" >
< a href = "../Protocols/ImageContainer.html" > ImageContainer< / a >
< / li >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatableP8animatorAA8AnimatorCSgv" > < / a >
2016-10-02 23:33:56 +00:00
< a name = "//apple_ref/swift/Property/animator" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatableP8animatorAA8AnimatorCSgv" > animator< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatableP5layerSo7CALayerCv" > < / a >
2016-10-02 23:33:56 +00:00
< a name = "//apple_ref/swift/Property/layer" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatableP5layerSo7CALayerCv" > layer< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatableP5frameSC6CGRectVv" > < / a >
2016-10-02 23:33:56 +00:00
< a name = "//apple_ref/swift/Property/frame" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatableP5frameSC6CGRectVv" > frame< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatableP11contentModeSC013UIViewContentD0Ov" > < / a >
2016-10-02 23:33:56 +00:00
< a name = "//apple_ref/swift/Property/contentMode" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatableP11contentModeSC013UIViewContentD0Ov" > contentMode< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePA2aBRzAA14ImageContainerRzlE20intrinsicContentSizeSC6CGSizeVv" > < / a >
2016-10-02 23:33:56 +00:00
< a name = "//apple_ref/swift/Property/intrinsicContentSize" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePA2aBRzAA14ImageContainerRzlE20intrinsicContentSizeSC6CGSizeVv" > intrinsicContentSize< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2016-10-08 17:36:32 +00:00
< / ul >
< / div >
< div class = "task-group" >
< ul >
2017-01-05 00:19:12 +00:00
< li class = "item" >
< div >
< code >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE15gifLoopDurationSdv" > < / a >
2017-01-05 00:19:12 +00:00
< a name = "//apple_ref/swift/Property/gifLoopDuration" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE15gifLoopDurationSdv" > gifLoopDuration< / a >
2017-01-05 00:19:12 +00:00
< / 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 >
2016-10-02 23:33:56 +00:00
< li class = "item" >
< div >
< code >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE11activeFrameSo7UIImageCSgv" > < / a >
2016-10-02 23:33:56 +00:00
< a name = "//apple_ref/swift/Property/activeFrame" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE11activeFrameSo7UIImageCSgv" > activeFrame< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE10frameCountSiv" > < / a >
2016-10-02 23:33:56 +00:00
< a name = "//apple_ref/swift/Property/frameCount" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE10frameCountSiv" > frameCount< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE14isAnimatingGIFSbv" > < / a >
2016-10-02 23:33:56 +00:00
< a name = "//apple_ref/swift/Property/isAnimatingGIF" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE14isAnimatingGIFSbv" > isAnimatingGIF< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE7animateySS12withGIFNamed_Si9loopCounttF" > < / a >
2017-01-05 00:19:12 +00:00
< a name = "//apple_ref/swift/Method/animate(withGIFNamed:loopCount:)" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE7animateySS12withGIFNamed_Si9loopCounttF" > animate(withGIFNamed:loopCount:)< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-01-05 00:19:12 +00:00
< 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 > < / code > < / pre >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-01-05 00:19:12 +00:00
< tr >
< td >
< code >
< em > loopCount< / em >
< / code >
< / td >
< td >
< div >
< p > Desired number of loops, < = 0 for infinite loop.< / p >
< / div >
< / td >
< / tr >
2016-10-02 23:33:56 +00:00
< / tbody >
< / table >
< / div >
< / section >
< / div >
< / li >
< li class = "item" >
< div >
< code >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE7animatey10Foundation4DataV11withGIFData_Si9loopCounttF" > < / a >
2017-01-05 00:19:12 +00:00
< a name = "//apple_ref/swift/Method/animate(withGIFData:loopCount:)" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE7animatey10Foundation4DataV11withGIFData_Si9loopCounttF" > animate(withGIFData:loopCount:)< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-01-05 00:19:12 +00:00
< 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 > < / code > < / pre >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-01-05 00:19:12 +00:00
< tr >
< td >
< code >
< em > loopCount< / em >
< / code >
< / td >
< td >
< div >
< p > Desired number of loops, < = 0 for infinite loop.< / p >
2017-12-31 19:08:19 +00:00
< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
< / section >
< / div >
< / li >
< li class = "item" >
< div >
< code >
< a name = "/s:4Gifu13GIFAnimatablePAAE7animatey10Foundation3URLV10withGIFURL_Si9loopCounttF" > < / a >
< a name = "//apple_ref/swift/Method/animate(withGIFURL:loopCount:)" class = "dashAnchor" > < / a >
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE7animatey10Foundation3URLV10withGIFURL_Si9loopCounttF" > animate(withGIFURL:loopCount:)< / 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 > < / code > < / pre >
2017-01-05 00:19:12 +00:00
2017-12-31 19:08:19 +00:00
< / 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 >
2017-01-05 00:19:12 +00:00
< / div >
< / td >
< / tr >
2016-10-02 23:33:56 +00:00
< / tbody >
< / table >
< / div >
< / section >
< / div >
< / li >
< li class = "item" >
< div >
< code >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationySS12withGIFNamed_Si9loopCountyycSg17completionHandlertF" > < / a >
2017-01-05 00:19:12 +00:00
< a name = "//apple_ref/swift/Method/prepareForAnimation(withGIFNamed:loopCount:completionHandler:)" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationySS12withGIFNamed_Si9loopCountyycSg17completionHandlertF" > prepareForAnimation(withGIFNamed:loopCount:completionHandler:)< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-12-31 19:08:19 +00:00
< 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 >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-01-05 00:19:12 +00:00
< tr >
< td >
< code >
< em > loopCount< / em >
< / code >
< / td >
< td >
< div >
< p > Desired number of loops, < = 0 for infinite loop.< / p >
< / div >
< / td >
< / tr >
2016-10-02 23:33:56 +00:00
< / tbody >
< / table >
< / div >
< / section >
< / div >
< / li >
< li class = "item" >
< div >
< code >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationy10Foundation4DataV11withGIFData_Si9loopCountyycSg17completionHandlertF" > < / a >
2017-01-05 00:19:12 +00:00
< a name = "//apple_ref/swift/Method/prepareForAnimation(withGIFData:loopCount:completionHandler:)" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationy10Foundation4DataV11withGIFData_Si9loopCountyycSg17completionHandlertF" > prepareForAnimation(withGIFData:loopCount:completionHandler:)< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-12-31 19:08:19 +00:00
< 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 >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-01-05 00:19:12 +00:00
< tr >
< td >
< code >
< em > loopCount< / em >
< / code >
< / td >
< td >
< div >
< p > Desired number of loops, < = 0 for infinite loop.< / p >
2017-12-31 19:08:19 +00:00
< / 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 >
2017-01-05 00:19:12 +00:00
2017-12-31 19:08:19 +00:00
< / 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 >
2017-01-05 00:19:12 +00:00
< / div >
< / td >
< / tr >
2016-10-02 23:33:56 +00:00
< / tbody >
< / table >
< / div >
< / section >
< / div >
< / li >
< li class = "item" >
< div >
< code >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE15prepareForReuseyyF" > < / a >
2016-10-02 23:33:56 +00:00
< a name = "//apple_ref/swift/Method/prepareForReuse()" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE15prepareForReuseyyF" > prepareForReuse()< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE17startAnimatingGIFyyF" > < / a >
2016-10-02 23:33:56 +00:00
< a name = "//apple_ref/swift/Method/startAnimatingGIF()" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE17startAnimatingGIFyyF" > startAnimatingGIF()< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE16stopAnimatingGIFyyF" > < / a >
2016-10-02 23:33:56 +00:00
< a name = "//apple_ref/swift/Method/stopAnimatingGIF()" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE16stopAnimatingGIFyyF" > stopAnimatingGIF()< / a >
2016-10-02 23:33:56 +00:00
< / 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 >
2016-10-09 16:12:29 +00:00
< / section >
< / div >
< / li >
< li class = "item" >
< div >
< code >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE21setShouldResizeFramesySbF" > < / a >
2016-10-09 16:12:29 +00:00
< a name = "//apple_ref/swift/Method/setShouldResizeFrames(_:)" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE21setShouldResizeFramesySbF" > setShouldResizeFrames(_:)< / a >
2016-10-09 16:12:29 +00:00
< / 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 >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE19setFrameBufferCountySiF" > < / a >
2016-10-09 16:12:29 +00:00
< a name = "//apple_ref/swift/Method/setFrameBufferCount(_:)" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE19setFrameBufferCountySiF" > setFrameBufferCount(_:)< / a >
2016-10-09 16:12:29 +00:00
< / 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 >
2016-10-02 23:33:56 +00:00
< / section >
< / div >
< / li >
< li class = "item" >
< div >
< code >
2017-12-31 19:08:19 +00:00
< a name = "/s:4Gifu13GIFAnimatablePAAE19updateImageIfNeededyyF" > < / a >
2016-10-02 23:33:56 +00:00
< a name = "//apple_ref/swift/Method/updateImageIfNeeded()" class = "dashAnchor" > < / a >
2017-12-31 19:08:19 +00:00
< a class = "token" href = "#/s:4Gifu13GIFAnimatablePAAE19updateImageIfNeededyyF" > updateImageIfNeeded()< / a >
2016-10-02 23:33:56 +00:00
< / 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 > 2015 © Reda Lemeden. See LICENSE for more details.< / p >
2017-12-31 19:08:19 +00:00
< 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 >
2016-10-02 23:33:56 +00:00
< / section >
< / article >
< / div >
< / body >
< / div >
< / html >