Răsfoiți Sursa

Early return when no animator found

onevcat 5 ani în urmă
părinte
comite
18e3e15b54
1 a modificat fișierele cu 2 adăugiri și 3 ștergeri
  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
     }