diff --git a/docs/Classes.html b/docs/Classes.html index 1206469..9fd3472 100644 --- a/docs/Classes.html +++ b/docs/Classes.html @@ -65,9 +65,9 @@
  • - + - GIFImageView + GIFImageView
    @@ -97,9 +97,9 @@
  • - + - Animator + Animator
    @@ -128,7 +128,7 @@
    diff --git a/docs/Classes/Animator.html b/docs/Classes/Animator.html index 3732587..29d8731 100644 --- a/docs/Classes/Animator.html +++ b/docs/Classes/Animator.html @@ -72,9 +72,9 @@
  • - + - init(withDelegate:) + init(withDelegate:)
    @@ -105,8 +105,7 @@
    -

    A view object that implements the GIFAnimatable protocol.

    - +

    A view object that implements the GIFAnimatable protocol.

    @@ -116,7 +115,6 @@

    Return Value

    A new animator instance.

    -
    @@ -127,7 +125,7 @@ diff --git a/docs/Classes/GIFImageView.html b/docs/Classes/GIFImageView.html index 35aca70..b584c52 100644 --- a/docs/Classes/GIFImageView.html +++ b/docs/Classes/GIFImageView.html @@ -72,9 +72,9 @@
  • - + - animator + animator
    @@ -99,9 +99,9 @@
  • - + - display(_:) + display(_:)
    @@ -133,7 +133,6 @@

    The delegated layer.

    -
    @@ -149,7 +148,7 @@
    diff --git a/docs/Protocols.html b/docs/Protocols.html index 418373b..0a0c464 100644 --- a/docs/Protocols.html +++ b/docs/Protocols.html @@ -65,9 +65,9 @@
  • - + - GIFAnimatable + GIFAnimatable
    @@ -93,9 +93,9 @@
  • - + - ImageContainer + ImageContainer
    @@ -124,7 +124,7 @@
    diff --git a/docs/Protocols/GIFAnimatable.html b/docs/Protocols/GIFAnimatable.html index 29cda6e..46020a3 100644 --- a/docs/Protocols/GIFAnimatable.html +++ b/docs/Protocols/GIFAnimatable.html @@ -72,9 +72,9 @@
  • - + - animator + animator
    @@ -99,9 +99,9 @@
  • - + - layer + layer
    @@ -126,9 +126,9 @@
  • - + - frame + frame
    @@ -153,9 +153,9 @@
  • - + - contentMode + contentMode
    @@ -184,9 +184,9 @@
  • - + - intrinsicContentSize + intrinsicContentSize Extension method @@ -218,9 +218,9 @@
  • - + - gifLoopDuration + gifLoopDuration Extension method @@ -248,9 +248,9 @@
  • - + - activeFrame + activeFrame Extension method @@ -278,9 +278,9 @@
  • - + - frameCount + frameCount Extension method @@ -308,9 +308,9 @@
  • - + - isAnimatingGIF + isAnimatingGIF Extension method @@ -338,9 +338,9 @@
  • - + - animate(withGIFNamed:loopCount:) + animate(withGIFNamed:loopCount:) Extension method @@ -375,7 +375,6 @@

    The file name of the GIF in the main bundle.

    -
    @@ -388,7 +387,6 @@

    Desired number of loops, <= 0 for infinite loop.

    -
    @@ -401,9 +399,9 @@
  • - + - animate(withGIFData:loopCount:) + animate(withGIFData:loopCount:) Extension method @@ -438,7 +436,6 @@

    GIF image data.

    -
    @@ -451,7 +448,6 @@

    Desired number of loops, <= 0 for infinite loop.

    -
    @@ -464,72 +460,9 @@
  • - - - prepareForAnimation(withGIFNamed:loopCount:completionHandler:) - - - Extension method - -
    -
    -
    -
    -
    -
    -

    Prepares the animator instance for animation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func prepareForAnimation(withGIFNamed imageName: String, loopCount: Int = 0, completionHandler: ((Void) -> Void)? = .none)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - imageName - - -
    -

    The file name of the GIF in the main bundle.

    - -
    -
    - - loopCount - - -
    -

    Desired number of loops, <= 0 for infinite loop.

    - -
    -
    -
    -
    -
    -
  • -
  • -
    - - - - prepareForAnimation(withGIFData:loopCount:completionHandler:) + + + animate(withGIFURL:loopCount:) Extension method @@ -547,7 +480,133 @@

    Declaration

    Swift

    -
    public func prepareForAnimation(withGIFData imageData: Data, loopCount: Int = 0, completionHandler: ((Void) -> Void)? = .none)
    +
    public func animate(withGIFURL imageURL: URL, loopCount: Int = 0)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + imageURL + + +
    +

    GIF image url.

    +
    +
    + + loopCount + + +
    +

    Desired number of loops, <= 0 for infinite loop.

    +
    +
    +
    + + +
  • +
  • +
    + + + + prepareForAnimation(withGIFNamed:loopCount:completionHandler:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Prepares the animator instance for animation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func prepareForAnimation(withGIFNamed imageName: String,
    +                                loopCount: Int = 0,
    +                                completionHandler: (() -> Void)? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + imageName + + +
    +

    The file name of the GIF in the main bundle.

    +
    +
    + + loopCount + + +
    +

    Desired number of loops, <= 0 for infinite loop.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + prepareForAnimation(withGIFData:loopCount:completionHandler:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Prepare for animation and start animating immediately.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func prepareForAnimation(withGIFData imageData: Data,
    +                                loopCount: Int = 0,
    +                                completionHandler: (() -> Void)? = nil)
    @@ -564,7 +623,6 @@

    GIF image data.

    -
    @@ -577,7 +635,6 @@

    Desired number of loops, <= 0 for infinite loop.

    -
    @@ -590,9 +647,72 @@
  • - + + + prepareForAnimation(withGIFURL:loopCount:completionHandler:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Prepare for animation and start animating immediately.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func prepareForAnimation(withGIFURL imageURL: URL,
    +                                loopCount: Int = 0,
    +                                completionHandler: (() -> Void)? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + imageURL + + +
    +

    GIF image url.

    +
    +
    + + loopCount + + +
    +

    Desired number of loops, <= 0 for infinite loop.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + - prepareForReuse() + prepareForReuse() Extension method @@ -620,9 +740,9 @@
  • - + - startAnimatingGIF() + startAnimatingGIF() Extension method @@ -650,9 +770,9 @@
  • - + - stopAnimatingGIF() + stopAnimatingGIF() Extension method @@ -680,9 +800,9 @@
  • - + - setShouldResizeFrames(_:) + setShouldResizeFrames(_:) Extension method @@ -717,7 +837,6 @@

    Boolean value indicating whether individual frames should be resized.

    -
    @@ -730,9 +849,9 @@
  • - + - setFrameBufferCount(_:) + setFrameBufferCount(_:) Extension method @@ -767,7 +886,6 @@

    The number of frames to buffer.

    -
    @@ -780,9 +898,9 @@
  • - + - updateImageIfNeeded() + updateImageIfNeeded() Extension method @@ -813,7 +931,7 @@
  • diff --git a/docs/Protocols/ImageContainer.html b/docs/Protocols/ImageContainer.html index d61d2ea..3ec3143 100644 --- a/docs/Protocols/ImageContainer.html +++ b/docs/Protocols/ImageContainer.html @@ -72,9 +72,9 @@
  • - + - image + image
    @@ -102,7 +102,7 @@
    diff --git a/docs/badge.svg b/docs/badge.svg new file mode 100644 index 0000000..a096fec --- /dev/null +++ b/docs/badge.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + documentation + + + documentation + + + 100% + + + 100% + + + diff --git a/docs/css/jazzy.css b/docs/css/jazzy.css index d6d65b7..d628282 100644 --- a/docs/css/jazzy.css +++ b/docs/css/jazzy.css @@ -164,6 +164,11 @@ header { padding-top: 10px; } .main-content section .task-group-section .task-group:first-of-type .section-name { padding-top: 15px; } + .main-content section .heading:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } .section { padding: 0 25px; } diff --git a/docs/docsets/Gifu.docset/Contents/Resources/Documents/Classes.html b/docs/docsets/Gifu.docset/Contents/Resources/Documents/Classes.html index 1206469..9fd3472 100644 --- a/docs/docsets/Gifu.docset/Contents/Resources/Documents/Classes.html +++ b/docs/docsets/Gifu.docset/Contents/Resources/Documents/Classes.html @@ -65,9 +65,9 @@
  • - + - GIFImageView + GIFImageView
    @@ -97,9 +97,9 @@
  • - + - Animator + Animator
    @@ -128,7 +128,7 @@
    diff --git a/docs/docsets/Gifu.docset/Contents/Resources/Documents/Classes/Animator.html b/docs/docsets/Gifu.docset/Contents/Resources/Documents/Classes/Animator.html index 3732587..29d8731 100644 --- a/docs/docsets/Gifu.docset/Contents/Resources/Documents/Classes/Animator.html +++ b/docs/docsets/Gifu.docset/Contents/Resources/Documents/Classes/Animator.html @@ -72,9 +72,9 @@
  • - + - init(withDelegate:) + init(withDelegate:)
    @@ -105,8 +105,7 @@
    -

    A view object that implements the GIFAnimatable protocol.

    - +

    A view object that implements the GIFAnimatable protocol.

    @@ -116,7 +115,6 @@

    Return Value

    A new animator instance.

    -
    @@ -127,7 +125,7 @@ diff --git a/docs/docsets/Gifu.docset/Contents/Resources/Documents/Classes/GIFImageView.html b/docs/docsets/Gifu.docset/Contents/Resources/Documents/Classes/GIFImageView.html index 35aca70..b584c52 100644 --- a/docs/docsets/Gifu.docset/Contents/Resources/Documents/Classes/GIFImageView.html +++ b/docs/docsets/Gifu.docset/Contents/Resources/Documents/Classes/GIFImageView.html @@ -72,9 +72,9 @@
  • - + - animator + animator
    @@ -99,9 +99,9 @@
  • - + - display(_:) + display(_:)
    @@ -133,7 +133,6 @@

    The delegated layer.

    -
    @@ -149,7 +148,7 @@
    diff --git a/docs/docsets/Gifu.docset/Contents/Resources/Documents/Protocols.html b/docs/docsets/Gifu.docset/Contents/Resources/Documents/Protocols.html index 418373b..0a0c464 100644 --- a/docs/docsets/Gifu.docset/Contents/Resources/Documents/Protocols.html +++ b/docs/docsets/Gifu.docset/Contents/Resources/Documents/Protocols.html @@ -65,9 +65,9 @@
  • - + - GIFAnimatable + GIFAnimatable
    @@ -93,9 +93,9 @@
  • - + - ImageContainer + ImageContainer
    @@ -124,7 +124,7 @@
    diff --git a/docs/docsets/Gifu.docset/Contents/Resources/Documents/Protocols/GIFAnimatable.html b/docs/docsets/Gifu.docset/Contents/Resources/Documents/Protocols/GIFAnimatable.html index 29cda6e..46020a3 100644 --- a/docs/docsets/Gifu.docset/Contents/Resources/Documents/Protocols/GIFAnimatable.html +++ b/docs/docsets/Gifu.docset/Contents/Resources/Documents/Protocols/GIFAnimatable.html @@ -72,9 +72,9 @@
  • - + - animator + animator
    @@ -99,9 +99,9 @@
  • - + - layer + layer
    @@ -126,9 +126,9 @@
  • - + - frame + frame
    @@ -153,9 +153,9 @@
  • - + - contentMode + contentMode
    @@ -184,9 +184,9 @@
  • - + - intrinsicContentSize + intrinsicContentSize Extension method @@ -218,9 +218,9 @@
  • - + - gifLoopDuration + gifLoopDuration Extension method @@ -248,9 +248,9 @@
  • - + - activeFrame + activeFrame Extension method @@ -278,9 +278,9 @@
  • - + - frameCount + frameCount Extension method @@ -308,9 +308,9 @@
  • - + - isAnimatingGIF + isAnimatingGIF Extension method @@ -338,9 +338,9 @@
  • - + - animate(withGIFNamed:loopCount:) + animate(withGIFNamed:loopCount:) Extension method @@ -375,7 +375,6 @@

    The file name of the GIF in the main bundle.

    -
    @@ -388,7 +387,6 @@

    Desired number of loops, <= 0 for infinite loop.

    -
    @@ -401,9 +399,9 @@
  • - + - animate(withGIFData:loopCount:) + animate(withGIFData:loopCount:) Extension method @@ -438,7 +436,6 @@

    GIF image data.

    -
    @@ -451,7 +448,6 @@

    Desired number of loops, <= 0 for infinite loop.

    -
    @@ -464,72 +460,9 @@
  • - - - prepareForAnimation(withGIFNamed:loopCount:completionHandler:) - - - Extension method - -
    -
    -
    -
    -
    -
    -

    Prepares the animator instance for animation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func prepareForAnimation(withGIFNamed imageName: String, loopCount: Int = 0, completionHandler: ((Void) -> Void)? = .none)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - imageName - - -
    -

    The file name of the GIF in the main bundle.

    - -
    -
    - - loopCount - - -
    -

    Desired number of loops, <= 0 for infinite loop.

    - -
    -
    -
    -
    -
    -
  • -
  • -
    - - - - prepareForAnimation(withGIFData:loopCount:completionHandler:) + + + animate(withGIFURL:loopCount:) Extension method @@ -547,7 +480,133 @@

    Declaration

    Swift

    -
    public func prepareForAnimation(withGIFData imageData: Data, loopCount: Int = 0, completionHandler: ((Void) -> Void)? = .none)
    +
    public func animate(withGIFURL imageURL: URL, loopCount: Int = 0)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + imageURL + + +
    +

    GIF image url.

    +
    +
    + + loopCount + + +
    +

    Desired number of loops, <= 0 for infinite loop.

    +
    +
    +
    + + +
  • +
  • +
    + + + + prepareForAnimation(withGIFNamed:loopCount:completionHandler:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Prepares the animator instance for animation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func prepareForAnimation(withGIFNamed imageName: String,
    +                                loopCount: Int = 0,
    +                                completionHandler: (() -> Void)? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + imageName + + +
    +

    The file name of the GIF in the main bundle.

    +
    +
    + + loopCount + + +
    +

    Desired number of loops, <= 0 for infinite loop.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + prepareForAnimation(withGIFData:loopCount:completionHandler:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Prepare for animation and start animating immediately.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func prepareForAnimation(withGIFData imageData: Data,
    +                                loopCount: Int = 0,
    +                                completionHandler: (() -> Void)? = nil)
    @@ -564,7 +623,6 @@

    GIF image data.

    -
    @@ -577,7 +635,6 @@

    Desired number of loops, <= 0 for infinite loop.

    -
    @@ -590,9 +647,72 @@
  • - + + + prepareForAnimation(withGIFURL:loopCount:completionHandler:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Prepare for animation and start animating immediately.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func prepareForAnimation(withGIFURL imageURL: URL,
    +                                loopCount: Int = 0,
    +                                completionHandler: (() -> Void)? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + imageURL + + +
    +

    GIF image url.

    +
    +
    + + loopCount + + +
    +

    Desired number of loops, <= 0 for infinite loop.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + - prepareForReuse() + prepareForReuse() Extension method @@ -620,9 +740,9 @@
  • - + - startAnimatingGIF() + startAnimatingGIF() Extension method @@ -650,9 +770,9 @@
  • - + - stopAnimatingGIF() + stopAnimatingGIF() Extension method @@ -680,9 +800,9 @@
  • - + - setShouldResizeFrames(_:) + setShouldResizeFrames(_:) Extension method @@ -717,7 +837,6 @@

    Boolean value indicating whether individual frames should be resized.

    -
    @@ -730,9 +849,9 @@
  • - + - setFrameBufferCount(_:) + setFrameBufferCount(_:) Extension method @@ -767,7 +886,6 @@

    The number of frames to buffer.

    -
    @@ -780,9 +898,9 @@
  • - + - updateImageIfNeeded() + updateImageIfNeeded() Extension method @@ -813,7 +931,7 @@
  • diff --git a/docs/docsets/Gifu.docset/Contents/Resources/Documents/Protocols/ImageContainer.html b/docs/docsets/Gifu.docset/Contents/Resources/Documents/Protocols/ImageContainer.html index d61d2ea..3ec3143 100644 --- a/docs/docsets/Gifu.docset/Contents/Resources/Documents/Protocols/ImageContainer.html +++ b/docs/docsets/Gifu.docset/Contents/Resources/Documents/Protocols/ImageContainer.html @@ -72,9 +72,9 @@
  • - + - image + image
    @@ -102,7 +102,7 @@
    diff --git a/docs/docsets/Gifu.docset/Contents/Resources/Documents/css/jazzy.css b/docs/docsets/Gifu.docset/Contents/Resources/Documents/css/jazzy.css index d6d65b7..d628282 100644 --- a/docs/docsets/Gifu.docset/Contents/Resources/Documents/css/jazzy.css +++ b/docs/docsets/Gifu.docset/Contents/Resources/Documents/css/jazzy.css @@ -164,6 +164,11 @@ header { padding-top: 10px; } .main-content section .task-group-section .task-group:first-of-type .section-name { padding-top: 15px; } + .main-content section .heading:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } .section { padding: 0 25px; } diff --git a/docs/docsets/Gifu.docset/Contents/Resources/Documents/index.html b/docs/docsets/Gifu.docset/Contents/Resources/Documents/index.html index 43590aa..527df1b 100644 --- a/docs/docsets/Gifu.docset/Contents/Resources/Documents/index.html +++ b/docs/docsets/Gifu.docset/Contents/Resources/Documents/index.html @@ -56,15 +56,15 @@
    -

    Logo

    +

    Logo

    -

    GitHub release Bitrise Carthage compatible Join the chat at https://gitter.im/kaishin/gifu Swift 3.0.x platforms

    +

    GitHub release Bitrise Carthage compatible Join the chat at https://gitter.im/kaishin/gifu Swift 3.0.x platforms

    Gifu adds protocol-based, performance-aware animated GIF support to UIKit. (It’s also a prefecture in Japan).

    -

    Swift 2.3 support is on the swift2.3 branch which will not be getting any future updates.

    -

    Install

    -

    Carthage

    +

    ⚠ The master branch works with Xcode 9 and iOS 11, which are both in beta. Use v2.0 for the stable version.

    +

    Install

    +

    Carthage

    • Add the following to your Cartfile: github "kaishin/Gifu"
    • @@ -72,34 +72,34 @@
    • Follow the current instructions in Carthage’s README for up to date installation instructions.
    -

    CocoaPods

    +

    CocoaPods

    • Add the following to your Podfile: 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.
    -

    How It Works

    +

    How It Works

    -

    Gifu does not require using the built-in GIFImageView subclass. 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.

    +

    Gifu does not require using the built-in GIFImageView subclass. 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.

    -

    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 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 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):

    -

    -

    Usage

    +

    +

    Usage

    There are two options that should cover any situation:

      -
    • Use the built-in GIFImageView subclass if you don’t need to combine GIF support with another image library.
    • -
    • If you need more flexibility and composability, make your class conform to GIFAnimatable. In practice, any UIView subclass would do, since you get most of the required properties for free. For best results, make your UIImageView subclass conform to GIFAnimatable to get access to other features such as intrinsic content size.
    • +
    • Use the built-in GIFImageView subclass if you don’t need to combine GIF support with another image library.
    • +
    • If you need more flexibility and composability, make your class conform to GIFAnimatable. In practice, any UIView subclass would do, since you get most of the required properties for free. For best results, make your UIImageView subclass conform to GIFAnimatable to get access to other features such as intrinsic content size.
    -

    GIFAnimatable

    +

    GIFAnimatable

    -

    The bread and butter of Gifu. Through protocol extensions, GIFAnimatable exposes all the APIs of the library, and with very little boilerplate, any class can conform to it.

    +

    The bread and butter of Gifu. Through protocol extensions, GIFAnimatable exposes all the APIs of the library, and with very little boilerplate, any class can conform to it.

    class MyImageView: UIImageView, GIFAnimatable {
       public lazy var animator: Animator? = {
         return Animator(withDelegate: self)
    @@ -164,9 +164,9 @@ containing 10 frames, Gifu will load the current frame (red), buffer the next tw
       }
     }
     
    -

    Examples

    +

    Examples

    -

    The simplest way to get started is initializing a GIFAnimatable class in code or in a storyboard, then calling animate(:) on it.

    +

    The simplest way to get started is initializing a GIFAnimatable class in code or in a storyboard, then calling animate(:) on it.

    let imageView = GIFImageView(frame: CGRect(x: 0, y: 0, width: 200, height: 100))
     imageView.animate(withGIFNamed: "mugen")
     
    @@ -188,26 +188,26 @@ containing 10 frames, Gifu will load the current frame (red), buffer the next tw } -

    If you are using a GIFAnimatable class in a table or collection view, you can call the prepareForReuse() method in your cell subclass:

    +

    If you are using a GIFAnimatable class in a table or collection view, you can call the prepareForReuse() method in your cell subclass:

    override func prepareForReuse() {
       super.prepareForReuse()
       imageView.prepareForReuse()
     }
     
    -

    Demo App

    +

    Demo App

    Clone or download the repository and open Gifu.xcworkspace to check out the demo app.

    -

    Documentation

    +

    Documentation

    See the full API documentation.

    -

    Compatibility

    +

    Compatibility

    • iOS 9.0+
    • Swift 3.0
    • Xcode 8.0
    -

    License

    +

    License

    See LICENSE.

    @@ -215,7 +215,7 @@ containing 10 frames, Gifu will load the current frame (red), buffer the next tw
    diff --git a/docs/docsets/Gifu.docset/Contents/Resources/Documents/js/jazzy.js b/docs/docsets/Gifu.docset/Contents/Resources/Documents/js/jazzy.js index 4ff9455..3965b5f 100755 --- a/docs/docsets/Gifu.docset/Contents/Resources/Documents/js/jazzy.js +++ b/docs/docsets/Gifu.docset/Contents/Resources/Documents/js/jazzy.js @@ -38,3 +38,9 @@ $(".token").click(function(event) { } event.preventDefault(); }); + +// Dumb down quotes within code blocks that delimit strings instead of quotations +// https://github.com/realm/jazzy/issues/714 +$("code q").replaceWith(function () { + return ["\"", $(this).contents(), "\""]; +}); diff --git a/docs/docsets/Gifu.docset/Contents/Resources/Documents/search.json b/docs/docsets/Gifu.docset/Contents/Resources/Documents/search.json new file mode 100644 index 0000000..32cefa2 --- /dev/null +++ b/docs/docsets/Gifu.docset/Contents/Resources/Documents/search.json @@ -0,0 +1 @@ +{"Protocols/ImageContainer.html#/s:4Gifu14ImageContainerP5imageSo7UIImageCSgv":{"name":"image","abstract":"

    Used for displaying the animation frames.

    ","parent_name":"ImageContainer"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatableP8animatorAA8AnimatorCSgv":{"name":"animator","abstract":"

    Responsible for managing the animation frames.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatableP5layerSo7CALayerCv":{"name":"layer","abstract":"

    Notifies the instance that it needs display.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatableP5frameSC6CGRectVv":{"name":"frame","abstract":"

    View frame used for resizing the frames.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatableP11contentModeSC013UIViewContentD0Ov":{"name":"contentMode","abstract":"

    Content mode used for resizing the frames.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePA2aBRzAA14ImageContainerRzlE20intrinsicContentSizeSC6CGSizeVv":{"name":"intrinsicContentSize","abstract":"

    Returns the intrinsic content size based on the size of the image.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE15gifLoopDurationSdv":{"name":"gifLoopDuration","abstract":"

    Total duration of one animation loop

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE11activeFrameSo7UIImageCSgv":{"name":"activeFrame","abstract":"

    Returns the active frame if available.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE10frameCountSiv":{"name":"frameCount","abstract":"

    Total frame count of the GIF.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE14isAnimatingGIFSbv":{"name":"isAnimatingGIF","abstract":"

    Introspect whether the instance is animating.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE7animateySS12withGIFNamed_Si9loopCounttF":{"name":"animate(withGIFNamed:loopCount:)","abstract":"

    Prepare for animation and start animating immediately.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE7animatey10Foundation4DataV11withGIFData_Si9loopCounttF":{"name":"animate(withGIFData:loopCount:)","abstract":"

    Prepare for animation and start animating immediately.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE7animatey10Foundation3URLV10withGIFURL_Si9loopCounttF":{"name":"animate(withGIFURL:loopCount:)","abstract":"

    Prepare for animation and start animating immediately.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationySS12withGIFNamed_Si9loopCountyycSg17completionHandlertF":{"name":"prepareForAnimation(withGIFNamed:loopCount:completionHandler:)","abstract":"

    Prepares the animator instance for animation.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationy10Foundation4DataV11withGIFData_Si9loopCountyycSg17completionHandlertF":{"name":"prepareForAnimation(withGIFData:loopCount:completionHandler:)","abstract":"

    Prepare for animation and start animating immediately.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationy10Foundation3URLV10withGIFURL_Si9loopCountyycSg17completionHandlertF":{"name":"prepareForAnimation(withGIFURL:loopCount:completionHandler:)","abstract":"

    Prepare for animation and start animating immediately.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE15prepareForReuseyyF":{"name":"prepareForReuse()","abstract":"

    Stop animating and free up GIF data from memory.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE17startAnimatingGIFyyF":{"name":"startAnimatingGIF()","abstract":"

    Start animating GIF.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE16stopAnimatingGIFyyF":{"name":"stopAnimatingGIF()","abstract":"

    Stop animating GIF.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE21setShouldResizeFramesySbF":{"name":"setShouldResizeFrames(_:)","abstract":"

    Whether the frame images should be resized or not. The default is false, which means that the frame images retain their original size.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE19setFrameBufferCountySiF":{"name":"setFrameBufferCount(_:)","abstract":"

    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.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE19updateImageIfNeededyyF":{"name":"updateImageIfNeeded()","abstract":"

    Updates the image with a new frame if necessary.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html":{"name":"GIFAnimatable","abstract":"

    The protocol that view classes need to conform to to enable animated GIF support.

    "},"Protocols/ImageContainer.html":{"name":"ImageContainer","abstract":"

    A single-property protocol that animatable classes can optionally conform to.

    "},"Classes/Animator.html#/s:4Gifu8AnimatorCAcA13GIFAnimatable_p12withDelegate_tcfc":{"name":"init(withDelegate:)","abstract":"

    Creates a new animator with a delegate.

    ","parent_name":"Animator"},"Classes/GIFImageView.html#/s:4Gifu12GIFImageViewC8animatorAA8AnimatorCSgv":{"name":"animator","abstract":"

    A lazy animator.

    ","parent_name":"GIFImageView"},"Classes/GIFImageView.html#/c:@M@Gifu@objc(cs)GIFImageView(im)displayLayer:":{"name":"display(_:)","abstract":"

    Layer delegate method called periodically by the layer. Should not be called manually.

    ","parent_name":"GIFImageView"},"Classes/GIFImageView.html":{"name":"GIFImageView","abstract":"

    Example class that conforms to GIFAnimatable. 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.

    "},"Classes/Animator.html":{"name":"Animator","abstract":"

    Responsible for parsing GIF data and decoding the individual frames.

    "},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "}} \ No newline at end of file diff --git a/docs/docsets/Gifu.docset/Contents/Resources/Documents/undocumented.json b/docs/docsets/Gifu.docset/Contents/Resources/Documents/undocumented.json deleted file mode 100644 index 2c06585..0000000 --- a/docs/docsets/Gifu.docset/Contents/Resources/Documents/undocumented.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "warnings": [ - - ], - "source_directory": "/Users/kaishin/Developer/Frameworks/Gifu" -} \ No newline at end of file diff --git a/docs/docsets/Gifu.docset/Contents/Resources/docSet.dsidx b/docs/docsets/Gifu.docset/Contents/Resources/docSet.dsidx index f75ab1c..87f765a 100644 Binary files a/docs/docsets/Gifu.docset/Contents/Resources/docSet.dsidx and b/docs/docsets/Gifu.docset/Contents/Resources/docSet.dsidx differ diff --git a/docs/docsets/Gifu.tgz b/docs/docsets/Gifu.tgz index a0cb9ca..3e962f7 100644 Binary files a/docs/docsets/Gifu.tgz and b/docs/docsets/Gifu.tgz differ diff --git a/docs/index.html b/docs/index.html index 43590aa..527df1b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -56,15 +56,15 @@
    -

    Logo

    +

    Logo

    -

    GitHub release Bitrise Carthage compatible Join the chat at https://gitter.im/kaishin/gifu Swift 3.0.x platforms

    +

    GitHub release Bitrise Carthage compatible Join the chat at https://gitter.im/kaishin/gifu Swift 3.0.x platforms

    Gifu adds protocol-based, performance-aware animated GIF support to UIKit. (It’s also a prefecture in Japan).

    -

    Swift 2.3 support is on the swift2.3 branch which will not be getting any future updates.

    -

    Install

    -

    Carthage

    +

    ⚠ The master branch works with Xcode 9 and iOS 11, which are both in beta. Use v2.0 for the stable version.

    +

    Install

    +

    Carthage

    • Add the following to your Cartfile: github "kaishin/Gifu"
    • @@ -72,34 +72,34 @@
    • Follow the current instructions in Carthage’s README for up to date installation instructions.
    -

    CocoaPods

    +

    CocoaPods

    • Add the following to your Podfile: 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.
    -

    How It Works

    +

    How It Works

    -

    Gifu does not require using the built-in GIFImageView subclass. 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.

    +

    Gifu does not require using the built-in GIFImageView subclass. 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.

    -

    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 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 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):

    -

    -

    Usage

    +

    +

    Usage

    There are two options that should cover any situation:

      -
    • Use the built-in GIFImageView subclass if you don’t need to combine GIF support with another image library.
    • -
    • If you need more flexibility and composability, make your class conform to GIFAnimatable. In practice, any UIView subclass would do, since you get most of the required properties for free. For best results, make your UIImageView subclass conform to GIFAnimatable to get access to other features such as intrinsic content size.
    • +
    • Use the built-in GIFImageView subclass if you don’t need to combine GIF support with another image library.
    • +
    • If you need more flexibility and composability, make your class conform to GIFAnimatable. In practice, any UIView subclass would do, since you get most of the required properties for free. For best results, make your UIImageView subclass conform to GIFAnimatable to get access to other features such as intrinsic content size.
    -

    GIFAnimatable

    +

    GIFAnimatable

    -

    The bread and butter of Gifu. Through protocol extensions, GIFAnimatable exposes all the APIs of the library, and with very little boilerplate, any class can conform to it.

    +

    The bread and butter of Gifu. Through protocol extensions, GIFAnimatable exposes all the APIs of the library, and with very little boilerplate, any class can conform to it.

    class MyImageView: UIImageView, GIFAnimatable {
       public lazy var animator: Animator? = {
         return Animator(withDelegate: self)
    @@ -164,9 +164,9 @@ containing 10 frames, Gifu will load the current frame (red), buffer the next tw
       }
     }
     
    -

    Examples

    +

    Examples

    -

    The simplest way to get started is initializing a GIFAnimatable class in code or in a storyboard, then calling animate(:) on it.

    +

    The simplest way to get started is initializing a GIFAnimatable class in code or in a storyboard, then calling animate(:) on it.

    let imageView = GIFImageView(frame: CGRect(x: 0, y: 0, width: 200, height: 100))
     imageView.animate(withGIFNamed: "mugen")
     
    @@ -188,26 +188,26 @@ containing 10 frames, Gifu will load the current frame (red), buffer the next tw } -

    If you are using a GIFAnimatable class in a table or collection view, you can call the prepareForReuse() method in your cell subclass:

    +

    If you are using a GIFAnimatable class in a table or collection view, you can call the prepareForReuse() method in your cell subclass:

    override func prepareForReuse() {
       super.prepareForReuse()
       imageView.prepareForReuse()
     }
     
    -

    Demo App

    +

    Demo App

    Clone or download the repository and open Gifu.xcworkspace to check out the demo app.

    -

    Documentation

    +

    Documentation

    See the full API documentation.

    -

    Compatibility

    +

    Compatibility

    • iOS 9.0+
    • Swift 3.0
    • Xcode 8.0
    -

    License

    +

    License

    See LICENSE.

    @@ -215,7 +215,7 @@ containing 10 frames, Gifu will load the current frame (red), buffer the next tw
    diff --git a/docs/js/jazzy.js b/docs/js/jazzy.js index 4ff9455..3965b5f 100755 --- a/docs/js/jazzy.js +++ b/docs/js/jazzy.js @@ -38,3 +38,9 @@ $(".token").click(function(event) { } event.preventDefault(); }); + +// Dumb down quotes within code blocks that delimit strings instead of quotations +// https://github.com/realm/jazzy/issues/714 +$("code q").replaceWith(function () { + return ["\"", $(this).contents(), "\""]; +}); diff --git a/docs/search.json b/docs/search.json new file mode 100644 index 0000000..32cefa2 --- /dev/null +++ b/docs/search.json @@ -0,0 +1 @@ +{"Protocols/ImageContainer.html#/s:4Gifu14ImageContainerP5imageSo7UIImageCSgv":{"name":"image","abstract":"

    Used for displaying the animation frames.

    ","parent_name":"ImageContainer"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatableP8animatorAA8AnimatorCSgv":{"name":"animator","abstract":"

    Responsible for managing the animation frames.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatableP5layerSo7CALayerCv":{"name":"layer","abstract":"

    Notifies the instance that it needs display.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatableP5frameSC6CGRectVv":{"name":"frame","abstract":"

    View frame used for resizing the frames.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatableP11contentModeSC013UIViewContentD0Ov":{"name":"contentMode","abstract":"

    Content mode used for resizing the frames.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePA2aBRzAA14ImageContainerRzlE20intrinsicContentSizeSC6CGSizeVv":{"name":"intrinsicContentSize","abstract":"

    Returns the intrinsic content size based on the size of the image.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE15gifLoopDurationSdv":{"name":"gifLoopDuration","abstract":"

    Total duration of one animation loop

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE11activeFrameSo7UIImageCSgv":{"name":"activeFrame","abstract":"

    Returns the active frame if available.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE10frameCountSiv":{"name":"frameCount","abstract":"

    Total frame count of the GIF.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE14isAnimatingGIFSbv":{"name":"isAnimatingGIF","abstract":"

    Introspect whether the instance is animating.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE7animateySS12withGIFNamed_Si9loopCounttF":{"name":"animate(withGIFNamed:loopCount:)","abstract":"

    Prepare for animation and start animating immediately.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE7animatey10Foundation4DataV11withGIFData_Si9loopCounttF":{"name":"animate(withGIFData:loopCount:)","abstract":"

    Prepare for animation and start animating immediately.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE7animatey10Foundation3URLV10withGIFURL_Si9loopCounttF":{"name":"animate(withGIFURL:loopCount:)","abstract":"

    Prepare for animation and start animating immediately.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationySS12withGIFNamed_Si9loopCountyycSg17completionHandlertF":{"name":"prepareForAnimation(withGIFNamed:loopCount:completionHandler:)","abstract":"

    Prepares the animator instance for animation.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationy10Foundation4DataV11withGIFData_Si9loopCountyycSg17completionHandlertF":{"name":"prepareForAnimation(withGIFData:loopCount:completionHandler:)","abstract":"

    Prepare for animation and start animating immediately.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE19prepareForAnimationy10Foundation3URLV10withGIFURL_Si9loopCountyycSg17completionHandlertF":{"name":"prepareForAnimation(withGIFURL:loopCount:completionHandler:)","abstract":"

    Prepare for animation and start animating immediately.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE15prepareForReuseyyF":{"name":"prepareForReuse()","abstract":"

    Stop animating and free up GIF data from memory.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE17startAnimatingGIFyyF":{"name":"startAnimatingGIF()","abstract":"

    Start animating GIF.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE16stopAnimatingGIFyyF":{"name":"stopAnimatingGIF()","abstract":"

    Stop animating GIF.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE21setShouldResizeFramesySbF":{"name":"setShouldResizeFrames(_:)","abstract":"

    Whether the frame images should be resized or not. The default is false, which means that the frame images retain their original size.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE19setFrameBufferCountySiF":{"name":"setFrameBufferCount(_:)","abstract":"

    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.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html#/s:4Gifu13GIFAnimatablePAAE19updateImageIfNeededyyF":{"name":"updateImageIfNeeded()","abstract":"

    Updates the image with a new frame if necessary.

    ","parent_name":"GIFAnimatable"},"Protocols/GIFAnimatable.html":{"name":"GIFAnimatable","abstract":"

    The protocol that view classes need to conform to to enable animated GIF support.

    "},"Protocols/ImageContainer.html":{"name":"ImageContainer","abstract":"

    A single-property protocol that animatable classes can optionally conform to.

    "},"Classes/Animator.html#/s:4Gifu8AnimatorCAcA13GIFAnimatable_p12withDelegate_tcfc":{"name":"init(withDelegate:)","abstract":"

    Creates a new animator with a delegate.

    ","parent_name":"Animator"},"Classes/GIFImageView.html#/s:4Gifu12GIFImageViewC8animatorAA8AnimatorCSgv":{"name":"animator","abstract":"

    A lazy animator.

    ","parent_name":"GIFImageView"},"Classes/GIFImageView.html#/c:@M@Gifu@objc(cs)GIFImageView(im)displayLayer:":{"name":"display(_:)","abstract":"

    Layer delegate method called periodically by the layer. Should not be called manually.

    ","parent_name":"GIFImageView"},"Classes/GIFImageView.html":{"name":"GIFImageView","abstract":"

    Example class that conforms to GIFAnimatable. 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.

    "},"Classes/Animator.html":{"name":"Animator","abstract":"

    Responsible for parsing GIF data and decoding the individual frames.

    "},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "}} \ No newline at end of file