VDAnimation provides easy way to describe UIViewController transitions.
VDAnimation also supports transitions like Keynote’s Magic Move or Hero. It checks the .transition.id property on all source and destination views. Every matched view pair is then automatically transitioned from its old state to its new state.
VDAnimation
Description
This repository provides a new declarative way to describe animations
Example
Usage
UIViewAnimatesimple UIKit animation, it’s initialized by closure
Animatesimple SwiftUI animation, it’s initialized by closure
Sequentialsequential animations running one after another
Parallelparallel animations running simultaneously
Intervaltime interval
Instantany block of code, always zero duration
TimerAnimationCADisplayLinkwrapperInteractive
method
.start()or.delegate()returnsAnimationDelegateProtocolobjectAnimationDelegateProtocol.isRunning:Bool{ get }.position:AnimationPosition{ get nonmutating set }.options:AnimationOptions{ get }.play(with options: AnimationOptions).pause().stop(at position: AnimationPosition?).add(completion: @escaping (Bool) -> Void).cancel()Modifiers
.duration(TimeInterval)- sets the animation duration in seconds.duration(relative: Double)- sets the animation duration relative to the parent animation in 0…1.curve(BezierCurve)- sets the animation curve.spring(dampingRatio: CGFloat = 0.3)- sets spring animation curve (only forUIViewAnimate).repeat(),.repeat(Int)- repeat animation.autoreverse(),.autoreverse(repeat: Int)- autoreverse animation.reversed()- reversed animation.ca-UIView,CALayerandView,Bindingextension to describe an animation of propertiesTransitions
VDAnimation provides easy way to describe
UIViewControllertransitions. VDAnimation also supports transitions like Keynote’sMagic MoveorHero. It checks the.transition.idproperty on all source and destination views. Every matched view pair is then automatically transitioned from its old state to its new state.Installation
Add the following line to your Podfile:
and run
pod updatefrom the podfile directory first.Create a
Package.swiftfile.Author
dankinsoid, voidilov@gmail.com
License
VDAnimation is available under the MIT license. See the LICENSE file for more info.