Sfoglia il codice sorgente

Merge pull request #1452 from onevcat/fix/single-image-animated-view

Early return when no animator found
Wei Wang 5 anni fa
parent
commit
1c907b7eb1
1 ha cambiato i file con 2 aggiunte e 3 eliminazioni
  1. 2 3
      Sources/Views/AnimatedImageView.swift

+ 2 - 3
Sources/Views/AnimatedImageView.swift

@@ -205,9 +205,8 @@ open class AnimatedImageView: UIImageView {
     /// Starts the animation.
     override open func startAnimating() {
         guard !isAnimating else { return }
-        if animator?.isReachMaxRepeatCount ?? false {
-            return
-        }
+        guard let animator = animator else { return }
+        guard !animator.isReachMaxRepeatCount else { return }
 
         displayLink.isPaused = false
     }