Убрал устаревшее M_PI

This commit is contained in:
Ivan Vavilov 2017-08-28 11:54:29 +03:00
parent 7940750cea
commit c42cdd6db9
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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