【文件属性】:
文件名称:动画:适用于iOS,tvOS和macOS的Swift动画库
文件大小:2.38MB
文件格式:ZIP
更新时间:2021-02-03 10:24:29
macos ios tvos animation cocoapods
anim是一个用Swift编写的动画库,其中考虑了一个简单的声明性API。
// moves box to 100,100 with default settings
anim {
self . box . frame . origin = CGPoint ( x : 100 , y : 100 )
}
// after that, waits 100 ms
. wait ( 0.1 )
// moves box to 0,0 after waiting
. then {
self . box . frame . origin = CGPoint ( x : 0 , y : 0 )
}
// displays message after all animations are done
. callback {
print ( " Just finished moving :package: around. " )
}
它支持一堆缓动功能并链接多个动画。 它是Apple的UIViewPropertyAnimator的包装,在iOS和tvOS 10之前的版本中回