Animation framework
A simple animation framework
- TimeAnimator uses the swift Timer class for animation
- The animations wont be as smooth as using CAAnimation
- But TimeAnimator will give you more freedom than apple animation
- TimeAnimator will use CAAnimation soon. Stay tuned
- .package(url: "https://github.com/eonist/TimeAnimator.git", .branch("master"))
- Manual Open
TimeAnimator.xcodeproj
Quick one-liner:
TimeAnimator(duration: 0.3, onChange: {/*animate stuff*/},onComplete:{/*anim completed*/}).start()
Interpolating between 0 and 1:
let to = self.curX + 1
let animator = TimeAnimator(duration: 0.3)
animator.tick = {
Swift.print("animator.curCount: \(animator.curCount)")
Swift.print("animator.progress: \(animator.progress)")
self.curX = TimeAnimator.interpolate(from: from, to: to, fraction: animator.progress)
self.frame.origin.x = self.curX
}
animator.start()
Looping:
animator.onComplete = {
self.animator.reset()
self.animator.start()
}
- Add CAAnimation https://stackoverflow.com/questions/45307902/animate-cashapelayer-with-circle-uibezierpath-and-cabasicanimation
- Make project logo