From c42cdd6db9e2409b82d5ad5566bd6020252f75f0 Mon Sep 17 00:00:00 2001 From: Ivan Vavilov Date: Mon, 28 Aug 2017 11:54:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D1=83=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D1=80=D0=B5=D0=B2=D1=88=D0=B5=D0=B5=20M=5FPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Classes/Default/RMRPullToRefreshBaseView.swift | 6 +++--- Example/RMRPullToRefresh/PerekrestokView.swift | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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