图片默认旋转速度

This commit is contained in:
xaoxuu 2020-06-16 17:33:46 +08:00
parent 7a00253f3a
commit 1b4f42716b
5 changed files with 24 additions and 2 deletions

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "矩形@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "矩形@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -138,7 +138,7 @@ class TestAlertVC: BaseListVC {
vm.scene = .loading vm.scene = .loading
vm.title = "正在加载" vm.title = "正在加载"
} }
a.rotate(direction: .counterclockwise) a.rotate()
} }
} }
} }

View File

@ -156,7 +156,7 @@ internal extension UIView {
let ani = CABasicAnimation(keyPath: "transform.rotation.z") let ani = CABasicAnimation(keyPath: "transform.rotation.z")
ani.toValue = direction.rawValue * Double.pi * 2.0 ani.toValue = direction.rawValue * Double.pi * 2.0
if speed > 0 { if speed > 0 {
ani.duration = 4 / speed ani.duration = 2 / speed
} }
ani.repeatDuration = .infinity ani.repeatDuration = .infinity
layer.add(ani, forKey: "rotationAnimation") layer.add(ani, forKey: "rotationAnimation")