Spring - Animation
天朝子民
特性
- 链式语法。
- 无需继承。
- 轻量级扩展。
- 基于UIViewAnimation。
- 无代码侵入。
安装
CocoaPods - Podfile
pod 'SpringAnimation'
Carthage - Cartfile
github "lixiang1994/Spring"
使用方法
首先确保导入框架
import SpringAnimation
以下是使用示例。所有设备也都有模拟器版本可用
链式调用
animationView.spring
.opacity(0.1)
.scale(0.8, 0.8)
.duration(2)
.curve(.easeOutQuad)
.animate()
函数
animate()
animateNext { ... }
animateTo()
animateToNext { ... }
动画
shake
pop
morph
squeeze
wobble
swing
flipX
flipY
fall
squeezeLeft
squeezeRight
squeezeDown
squeezeUp
slideLeft
slideRight
slideDown
slideUp
fadeIn
fadeOut
fadeInLeft
fadeInRight
fadeInDown
fadeInUp
zoomIn
zoomOut
flash
曲线
spring
linear
easeIn
easeOut
easeInOut
属性
force
duration
delay
damping
velocity
repeatCount
scale
x
y
rotate
并非所有属性可以同时使用。
参考
贡献
如果您需要实现某些特定功能或有任何错误体验,请提交问题。如果您自己扩展了Spring的功能并希望其他人也能使用,请提交拉取请求。
许可证
Spring遵从MIT许可证。有关更多信息,请参阅LICENSE文件。