endRotate -> stopRotate

This commit is contained in:
xaoxuu 2020-06-23 18:42:08 +08:00
parent f0e6cb2fda
commit 3d385d3e11
2 changed files with 4 additions and 4 deletions

View File

@ -141,10 +141,10 @@ public extension LoadingRotateAnimation {
/// ///
/// - Parameter layer: /// - Parameter layer:
func endRotate(_ layer: CALayer? = nil) { func stopRotate(_ layer: CALayer? = nil) {
DispatchQueue.main.async { DispatchQueue.main.async {
self.animateLayer = nil self.animateLayer = nil
(layer ?? self.imageView.layer)?.endRotate() (layer ?? self.imageView.layer)?.stopRotate()
NotificationCenter.default.removeObserver(self, name: UIApplication.didEnterBackgroundNotification, object: nil) NotificationCenter.default.removeObserver(self, name: UIApplication.didEnterBackgroundNotification, object: nil)
NotificationCenter.default.removeObserver(self, name: UIApplication.willEnterForegroundNotification, object: nil) NotificationCenter.default.removeObserver(self, name: UIApplication.willEnterForegroundNotification, object: nil)
} }

View File

@ -245,8 +245,8 @@ extension CALayer {
} }
} }
/// ///
func endRotate() { func stopRotate() {
removeAnimation(forKey: .rotateKey) removeAnimation(forKey: .rotateKey)
} }