From 0b77356888e3b58343a65a392d3d0f04156021eb Mon Sep 17 00:00:00 2001 From: Storix Date: Fri, 11 Mar 2016 00:54:51 +0200 Subject: [PATCH] Add frameCount public property --- Source/AnimatableImageView.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/AnimatableImageView.swift b/Source/AnimatableImageView.swift index 58cf250..500a8ac 100644 --- a/Source/AnimatableImageView.swift +++ b/Source/AnimatableImageView.swift @@ -15,6 +15,11 @@ public class AnimatableImageView: UIImageView { return !displayLink.paused } + /// A computed property that returns the total number of frames in the GIF. + public var frameCount: Int { + return animator?.frameCount ?? 0 + } + /// Prepares the frames using a GIF image file name, without starting the animation. /// The file name should include the `.gif` extension. ///