parent
22397e9474
commit
3ac44fe7a9
|
@ -36,4 +36,3 @@ Carthage/Build
|
|||
|
||||
Gifu.framework.zip
|
||||
*.xcscmblueprint
|
||||
docs/
|
||||
|
|
132
README.md
132
README.md
|
@ -1,29 +1,14 @@
|
|||
# ![Gifu](https://db.tt/mZ1iMNXO)
|
||||
<h1><img src="https://github.com/kaishin/Gifu/raw/swift3/header.gif" alt="Gifu Logo" style="border-radius: 6px"></h1>
|
||||
|
||||
[![GitHub release](https://img.shields.io/github/release/kaishin/Gifu.svg?maxAge=2592000)](https://github.com/kaishin/Gifu/releases/latest) [![Travis](https://travis-ci.org/kaishin/Gifu.svg?branch=master)](https://travis-ci.org/kaishin/Gifu) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Join the chat at https://gitter.im/kaishin/gifu](https://badges.gitter.im/kaishin/gifu.svg)](https://gitter.im/kaishin/gifu)
|
||||
[![GitHub release](https://img.shields.io/github/release/kaishin/Gifu.svg?maxAge=2592000)](https://github.com/kaishin/Gifu/releases/latest) [![Travis](https://travis-ci.org/kaishin/Gifu.svg?branch=master)](https://travis-ci.org/kaishin/Gifu) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Join the chat at https://gitter.im/kaishin/gifu](https://badges.gitter.im/kaishin/gifu.svg)](https://gitter.im/kaishin/gifu) ![Swift 3.0.x](https://img.shields.io/badge/Swift-3.0.x-orange.svg) ![platforms](https://img.shields.io/badge/platforms-iOS-lightgrey.svg)
|
||||
|
||||
Adds performant animated GIF support to UIKit. If you're looking for the Japanese prefecture, click [here](https://goo.gl/maps/CCeAc).
|
||||
|
||||
⚠ **Swift 3.0** support is in progress on the [swift3](https://github.com/kaishin/Gifu/tree/swift3) branch.
|
||||
Gifu adds protocol-based, performance-aware animated GIF support to UIKit, without forcing you to use a `UIImageView` subclass. (It's also a [prefecture in Japan](https://goo.gl/maps/CCeAc)).
|
||||
|
||||
⚠ **Swift 2.3** support is on the [swift2.3](https://github.com/kaishin/Gifu/tree/swift2.3) branch. **This branch will not be getting any future updates**.
|
||||
|
||||
## Install
|
||||
|
||||
|
||||
#### How?
|
||||
|
||||
Gifu uses a `UIImageView` subclass and an animator that keeps track of frames and their durations.
|
||||
|
||||
It uses `CADisplayLink` to animate the view and only keeps a limited number of
|
||||
resized frames in-memory, which exponentially minimizes memory usage for large GIF files (+300 frames).
|
||||
|
||||
The figure below summarizes how this works in practice. Given an image
|
||||
containing 10 frames, Gifu will load the current frame (red), pre-load the next two frames in this example (orange), and nullify all the other frames to free up memory (gray):
|
||||
|
||||
<img src="https://db.tt/ZLfx23hg" width="300" />
|
||||
|
||||
#### Install
|
||||
#### [Carthage](https://github.com/Carthage/Carthage)
|
||||
### [Carthage](https://github.com/Carthage/Carthage)
|
||||
|
||||
- Add the following to your Cartfile: `github "kaishin/Gifu"`
|
||||
- Then run `carthage update`
|
||||
|
@ -32,40 +17,111 @@ for up to date installation instructions.
|
|||
|
||||
[carthage-installation]: https://github.com/Carthage/Carthage#adding-frameworks-to-an-application
|
||||
|
||||
#### [CocoaPods](http://cocoapods.org)
|
||||
### [CocoaPods](http://cocoapods.org)
|
||||
|
||||
- Add the following to your [Podfile](http://guides.cocoapods.org/using/the-podfile.html): `pod 'Gifu'`
|
||||
- You will also need to make sure you're opting into using frameworks: `use_frameworks!`
|
||||
- Then run `pod install` with CocoaPods 0.36 or newer.
|
||||
|
||||
#### Usage
|
||||
## How It Works
|
||||
|
||||
Start by instantiating an `AnimatableImageView` either in code or Interface Builder, then call `animateWithImage(named:)` or `animateWithImageData(data:)` on it.
|
||||
`Gifu` does not rely on subclassing `UIImageView`. The `Animator` class does the heavy-lifting, while the `GIFAnimatable` protocol exposes the functionality to the view classes that conform to it, using protocol extensions.
|
||||
|
||||
```swift
|
||||
let imageView = AnimatableImageView(frame: CGRect(...))
|
||||
imageView.animateWithImage(named: "mugen.gif")
|
||||
```
|
||||
You can stop the animation anytime using `imageView.stopAnimatingGIF()`, and resume
|
||||
it using `imageView.startAnimatingGIF()`.
|
||||
The `Animator` has a `FrameStore` that only keeps a limited number of frames in-memory, effectively creating a buffer for the animation without consuming all the available memory. This approach makes loading large GIFs a lot more resource-friendly.
|
||||
|
||||
The `isAnimatingGIF()` method returns the current animation state of the view if it has an animatable image.
|
||||
The figure below summarizes how this works in practice. Given an image
|
||||
containing 10 frames, Gifu will load the current frame (red), buffer the next two frames in this example (orange), and empty up all the other frames to free up memory (gray):
|
||||
|
||||
See the [full documentation](http://kaishin.github.io/Gifu/).
|
||||
<img src="https://db.tt/ZLfx23hg" width="300" />
|
||||
|
||||
#### Demo App
|
||||
## Usage
|
||||
|
||||
There are two options that should cover any situation:
|
||||
|
||||
- Use the built-in `GIFImageView` subclass.
|
||||
- Make `UIImageView` or any of its subclasses conform to `GIFAnimatable`.
|
||||
|
||||
### GIFImageView
|
||||
|
||||
A subclass of `UIImageView` that conforms to `GIFAnimatable`. You can use this class as-is or subclass it for further customization (not recommended).
|
||||
|
||||
### GIFAnimatable
|
||||
|
||||
The bread and butter of Gifu. Through protocol extensions, `GIFAnimatable` exposes all the APIs of the library, and with very little boilerplate, any `UIImageView` subclass can conform to it.
|
||||
|
||||
~~~swift
|
||||
class MyImageView: UIImageView, GIFAnimatable {
|
||||
public lazy var animator: Animator? = {
|
||||
return Animator(withDelegate: self)
|
||||
}()
|
||||
|
||||
override public func display(_ layer: CALayer) {
|
||||
updateImageIfNeeded()
|
||||
}
|
||||
}
|
||||
~~~
|
||||
|
||||
That's it. Now `MyImageView` is fully GIF-compatible, and any of these methods can be called on it:
|
||||
|
||||
- `prepareForAnimation(withGIFNamed:)` and `prepareForAnimation(withGIFData:)` to prepare the animator property for animation.
|
||||
- `startAnimatingGIF()` and `stopAnimatingGIF()` to control the animation.
|
||||
- `animate(withGIFNamed:)` and `animate(withGIFData:)` to prepare for animation and start animating immediately.
|
||||
- `frameCount`, `isAnimatingGIF`, and `activeFrame` to inspect the GIF view.
|
||||
- `prepareForReuse()` to free up resources.
|
||||
- `updateImageIfNeeded()` to update the image property if necessary.
|
||||
|
||||
### Examples
|
||||
|
||||
The simplest way to get started is initializing a `GIFAnimatable` class in code or in a storyboard, then calling `animate(:)` on it.
|
||||
|
||||
~~~swift
|
||||
let imageView = GIFImageView(frame: CGRect(x: 0, y: 0, width: 200, height: 100))
|
||||
imageView.animate(withGIFNamed: "mugen")
|
||||
~~~
|
||||
|
||||
You can also prepare for the animation when the view loads and only start animating after a user interaction.
|
||||
|
||||
~~~swift
|
||||
// In your view controller..
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
imageView.prepareForAnimation(withGIFNamed: "mugen")
|
||||
}
|
||||
|
||||
@IBAction func toggleAnimation(_ sender: AnyObject) {
|
||||
if imageView.isAnimatingGIF {
|
||||
imageView.stopAnimatingGIF()
|
||||
} else {
|
||||
imageView.startAnimatingGIF()
|
||||
}
|
||||
}
|
||||
~~~
|
||||
|
||||
If you are using a `GIFAnimatable` class in a table or collection view, you can call the `prepareForReuse()` method in your cell subclass:
|
||||
|
||||
~~~swift
|
||||
override func prepareForReuse() {
|
||||
super.prepareForReuse()
|
||||
imageView.prepareForReuse()
|
||||
}
|
||||
~~~
|
||||
|
||||
### Demo App
|
||||
|
||||
Clone or download the repository and open `Gifu.xcworkspace` to check out the demo app.
|
||||
|
||||
#### Compatibility
|
||||
## Documentation
|
||||
|
||||
- iOS 8+
|
||||
See the [full API documentation](http://kaishin.github.io/Gifu/).
|
||||
|
||||
#### Misc
|
||||
|
||||
- The font used in the logo is [Azuki](http://www.myfonts.com/fonts/bluevinyl/azuki/)
|
||||
- The characters used in the icon and example image in the demo are from [Samurai Champloo](https://en.wikipedia.org/wiki/Samurai_Champloo).
|
||||
## Compatibility
|
||||
|
||||
#### License
|
||||
- iOS 9.0+
|
||||
- Swift 3.0
|
||||
- Xcode 8.0
|
||||
|
||||
## License
|
||||
|
||||
See LICENSE.
|
||||
|
|
|
@ -85,7 +85,8 @@ extension GIFAnimatable {
|
|||
|
||||
/// Updates the image with a new frame if necessary.
|
||||
public func updateImageIfNeeded() {
|
||||
image = animator?.activeFrame() ?? image
|
||||
let frame = animator?.activeFrame() ?? image
|
||||
if image != frame { image = frame }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.2.1</string>
|
||||
<string>2.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>124</string>
|
||||
<string>132</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
|
|
|
@ -0,0 +1,134 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Classes 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 title="Classes 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" />
|
||||
Classes 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>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Classes</h1>
|
||||
<p>The following classes are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C4Gifu12GIFImageView"></a>
|
||||
<a name="//apple_ref/swift/Class/GIFImageView" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C4Gifu12GIFImageView">GIFImageView</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Example class that conforms to <code><a href="Protocols/GIFAnimatable.html">GIFAnimatable</a></code>. Uses default values for the animator frame buffer count and resize behavior. You can either use it directly in your code or use it as a blueprint for your own subclass.</p>
|
||||
|
||||
<a href="Classes/GIFImageView.html" class="slightly-smaller">See more</a>
|
||||
</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">class</span> <span class="kt">GIFImageView</span><span class="p">:</span> <span class="kt">UIImageView</span><span class="p">,</span> <span class="kt"><a href="Protocols/GIFAnimatable.html">GIFAnimatable</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C4Gifu8Animator"></a>
|
||||
<a name="//apple_ref/swift/Class/Animator" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C4Gifu8Animator">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 parsing GIF data and decoding the individual frames.</p>
|
||||
|
||||
<a href="Classes/Animator.html" class="slightly-smaller">See more</a>
|
||||
</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">class</span> <span class="kt">Animator</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>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.2</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
|
@ -0,0 +1,133 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Animator Class 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/Class/Animator" class="dashAnchor"></a>
|
||||
<a title="Animator Class 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" />
|
||||
Animator Class 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>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Animator</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">Animator</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Responsible for parsing GIF data and decoding the individual frames.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC4Gifu8AnimatorcFT12withDelegatePS_13GIFAnimatable__S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(withDelegate:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC4Gifu8AnimatorcFT12withDelegatePS_13GIFAnimatable__S0_">init(withDelegate:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates a new animator with a delegate.</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="nf">init</span><span class="p">(</span><span class="n">withDelegate</span> <span class="nv">delegate</span><span class="p">:</span> <span class="kt"><a href="../Protocols/GIFAnimatable.html">GIFAnimatable</a></span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>view</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A view object that implements the <code>GIFAnimatable</code> protocol.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A new animator instance.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>2015 © 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.7.2</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
|
@ -0,0 +1,155 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>GIFImageView Class 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/Class/GIFImageView" class="dashAnchor"></a>
|
||||
<a title="GIFImageView Class 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" />
|
||||
GIFImageView Class 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>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>GIFImageView</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">GIFImageView</span><span class="p">:</span> <span class="kt">UIImageView</span><span class="p">,</span> <span class="kt"><a href="../Protocols/GIFAnimatable.html">GIFAnimatable</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Example class that conforms to <code><a href="../Protocols/GIFAnimatable.html">GIFAnimatable</a></code>. Uses default values for the animator frame buffer count and resize behavior. You can either use it directly in your code or use it as a blueprint for your own subclass.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC4Gifu12GIFImageView8animatorGSqCS_8Animator_"></a>
|
||||
<a name="//apple_ref/swift/Property/animator" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC4Gifu12GIFImageView8animatorGSqCS_8Animator_">animator</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A lazy animator.</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">lazy</span> <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> <span class="o">=</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC4Gifu12GIFImageView7displayFCSo7CALayerT_"></a>
|
||||
<a name="//apple_ref/swift/Method/display(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC4Gifu12GIFImageView7displayFCSo7CALayerT_">display(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Layer delegate method called periodically by the layer. <strong>Should not</strong> be called manually.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">override</span> <span class="kd">public</span> <span class="kd">func</span> <span class="nf">display</span><span class="p">(</span><span class="n">_</span> <span class="nv">layer</span><span class="p">:</span> <span class="kt">CALayer</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>layer</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The delegated layer.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>2015 © 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.7.2</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
|
@ -0,0 +1,102 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Protocols 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 title="Protocols 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" />
|
||||
Protocols 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>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Protocols</h1>
|
||||
<p>The following protocols are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:P4Gifu13GIFAnimatable"></a>
|
||||
<a name="//apple_ref/swift/Protocol/GIFAnimatable" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:P4Gifu13GIFAnimatable">GIFAnimatable</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The protocol that view classes need to conform to to enable animated GIF support.</p>
|
||||
|
||||
<a href="Protocols/GIFAnimatable.html" class="slightly-smaller">See more</a>
|
||||
</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">protocol</span> <span class="kt">GIFAnimatable</span><span class="p">:</span> <span class="kd">class</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>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.2</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
|
@ -0,0 +1,660 @@
|
|||
<!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>
|
||||
</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:vP4Gifu13GIFAnimatable8animatorGSqCS_8Animator_"></a>
|
||||
<a name="//apple_ref/swift/Property/animator" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vP4Gifu13GIFAnimatable8animatorGSqCS_8Animator_">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:vP4Gifu13GIFAnimatable5imageGSqCSo7UIImage_"></a>
|
||||
<a name="//apple_ref/swift/Property/image" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vP4Gifu13GIFAnimatable5imageGSqCSo7UIImage_">image</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Used for displaying 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">image</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:vP4Gifu13GIFAnimatable5layerCSo7CALayer"></a>
|
||||
<a name="//apple_ref/swift/Property/layer" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vP4Gifu13GIFAnimatable5layerCSo7CALayer">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:vP4Gifu13GIFAnimatable5frameVSC6CGRect"></a>
|
||||
<a name="//apple_ref/swift/Property/frame" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vP4Gifu13GIFAnimatable5frameVSC6CGRect">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:vP4Gifu13GIFAnimatable11contentModeOSC17UIViewContentMode"></a>
|
||||
<a name="//apple_ref/swift/Property/contentMode" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vP4Gifu13GIFAnimatable11contentModeOSC17UIViewContentMode">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:vE4GifuPS_13GIFAnimatable20intrinsicContentSizeVSC6CGSize"></a>
|
||||
<a name="//apple_ref/swift/Property/intrinsicContentSize" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vE4GifuPS_13GIFAnimatable20intrinsicContentSizeVSC6CGSize">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>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vE4GifuPS_13GIFAnimatable11activeFrameGSqCSo7UIImage_"></a>
|
||||
<a name="//apple_ref/swift/Property/activeFrame" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vE4GifuPS_13GIFAnimatable11activeFrameGSqCSo7UIImage_">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:vE4GifuPS_13GIFAnimatable10frameCountSi"></a>
|
||||
<a name="//apple_ref/swift/Property/frameCount" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vE4GifuPS_13GIFAnimatable10frameCountSi">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:vE4GifuPS_13GIFAnimatable14isAnimatingGIFSb"></a>
|
||||
<a name="//apple_ref/swift/Property/isAnimatingGIF" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vE4GifuPS_13GIFAnimatable14isAnimatingGIFSb">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:FE4GifuPS_13GIFAnimatable7animateFT12withGIFNamedSS_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/animate(withGIFNamed:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4GifuPS_13GIFAnimatable7animateFT12withGIFNamedSS_T_">animate(withGIFNamed:)</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></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>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4GifuPS_13GIFAnimatable7animateFT11withGIFDataV10Foundation4Data_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/animate(withGIFData:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4GifuPS_13GIFAnimatable7animateFT11withGIFDataV10Foundation4Data_T_">animate(withGIFData:)</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></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>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4GifuPS_13GIFAnimatable19prepareForAnimationFT12withGIFNamedSS_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/prepareForAnimation(withGIFNamed:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4GifuPS_13GIFAnimatable19prepareForAnimationFT12withGIFNamedSS_T_">prepareForAnimation(withGIFNamed:)</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></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>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4GifuPS_13GIFAnimatable19prepareForAnimationFT11withGIFDataV10Foundation4Data_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/prepareForAnimation(withGIFData:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4GifuPS_13GIFAnimatable19prepareForAnimationFT11withGIFDataV10Foundation4Data_T_">prepareForAnimation(withGIFData:)</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></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>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FE4GifuPS_13GIFAnimatable15prepareForReuseFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/prepareForReuse()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4GifuPS_13GIFAnimatable15prepareForReuseFT_T_">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:FE4GifuPS_13GIFAnimatable17startAnimatingGIFFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/startAnimatingGIF()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4GifuPS_13GIFAnimatable17startAnimatingGIFFT_T_">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:FE4GifuPS_13GIFAnimatable16stopAnimatingGIFFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/stopAnimatingGIF()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FE4GifuPS_13GIFAnimatable16stopAnimatingGIFFT_T_">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>
|
||||