Skip to content

Commit

Permalink
Merge pull request onevcat#442 from xsxsxszs/Open_AnimatedImageView
Browse files Browse the repository at this point in the history
declare AnimateImageView as open
  • Loading branch information
onevcat authored Sep 17, 2016
2 parents 6c81e4e + a2f3367 commit 8773312
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Sources/AnimatedImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import UIKit
import ImageIO

/// `AnimatedImageView` is a subclass of `UIImageView` for displaying animated image.
public class AnimatedImageView: UIImageView {
open class AnimatedImageView: UIImageView {

/// Proxy object for prevending a reference cycle between the CADDisplayLink and AnimatedImageView.
class TargetProxy {
Expand Down Expand Up @@ -91,7 +91,7 @@ public class AnimatedImageView: UIImageView {
}()

// MARK: - Override
override public var image: Image? {
override open var image: Image? {
didSet {
if image != oldValue {
reset()
Expand All @@ -107,7 +107,7 @@ public class AnimatedImageView: UIImageView {
}
}

override public var isAnimating: Bool {
override open var isAnimating: Bool {
if isDisplayLinkInitialized {
return !displayLink.isPaused
} else {
Expand All @@ -116,7 +116,7 @@ public class AnimatedImageView: UIImageView {
}

/// Starts the animation.
override public func startAnimating() {
override open func startAnimating() {
if self.isAnimating {
return
} else {
Expand All @@ -125,27 +125,27 @@ public class AnimatedImageView: UIImageView {
}

/// Stops the animation.
override public func stopAnimating() {
override open func stopAnimating() {
super.stopAnimating()
if isDisplayLinkInitialized {
displayLink.isPaused = true
}
}

override public func display(_ layer: CALayer) {
override open func display(_ layer: CALayer) {
if let currentFrame = animator?.currentFrame {
layer.contents = currentFrame.cgImage
} else {
layer.contents = image?.cgImage
}
}

override public func didMoveToWindow() {
override open func didMoveToWindow() {
super.didMoveToWindow()
didMove()
}

override public func didMoveToSuperview() {
override open func didMoveToSuperview() {
super.didMoveToSuperview()
didMove()
}
Expand Down

0 comments on commit 8773312

Please sign in to comment.