diff --git a/Classes/Default/RMRPullToRefreshBaseView.swift b/Classes/Default/RMRPullToRefreshBaseView.swift index da4b81d..af3837e 100755 --- a/Classes/Default/RMRPullToRefreshBaseView.swift +++ b/Classes/Default/RMRPullToRefreshBaseView.swift @@ -85,7 +85,7 @@ class RMRPullToRefreshBaseView: RMRPullToRefreshView { func resetTransformIfNecessary() { if !isConfigured { - logoImageView.transform = CGAffineTransform(rotationAngle: CGFloat(M_PI)) + logoImageView.transform = CGAffineTransform(rotationAngle: .pi) didRotateToBottom = true isConfigured = true } @@ -94,7 +94,7 @@ class RMRPullToRefreshBaseView: RMRPullToRefreshView { func makeIncreasePulling(_ animated: Bool) { didRotateToTop = true didRotateToBottom = false - let rotateTransform = logoImageView.transform.rotated(by: CGFloat(M_PI)); + let rotateTransform = logoImageView.transform.rotated(by: .pi); if animated { UIView .animate(withDuration: 0.4, animations: { [weak self] in self?.logoImageView.transform = rotateTransform @@ -107,7 +107,7 @@ class RMRPullToRefreshBaseView: RMRPullToRefreshView { func makeDecreasePulling(_ animated: Bool) { didRotateToBottom = true didRotateToTop = false - let rotateTransform = logoImageView.transform.rotated(by: -CGFloat(M_PI)); + let rotateTransform = logoImageView.transform.rotated(by: -.pi); if animated { UIView .animate(withDuration: 0.4, animations: { [weak self] in self?.logoImageView.transform = rotateTransform diff --git a/Example/RMRPullToRefresh/PerekrestokView.swift b/Example/RMRPullToRefresh/PerekrestokView.swift index bfbe8c3..6a27afa 100644 --- a/Example/RMRPullToRefresh/PerekrestokView.swift +++ b/Example/RMRPullToRefresh/PerekrestokView.swift @@ -23,7 +23,7 @@ class PerekrestokView: RMRPullToRefreshView { // MARK: - Private func angle(_ progress: CGFloat) -> CGFloat { - return -CGFloat(M_PI)/progress + return -.pi/progress } // MARK: - RMRPullToRefreshViewProtocol @@ -39,7 +39,7 @@ class PerekrestokView: RMRPullToRefreshView { override func beginLoadingAnimation() { let rotationAnimation = CABasicAnimation(keyPath: "transform.rotation.z") rotationAnimation.fromValue = fromValue - rotationAnimation.byValue = 2*M_PI + rotationAnimation.byValue = 2*Double.pi rotationAnimation.duration = 0.9 rotationAnimation.repeatCount = HUGE