소스 검색

Early return when no animator found

onevcat 5 년 전
부모
커밋
18e3e15b54
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  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
     }