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
UIViewAnimate
simple UIKit animation, it’s initialized by closure
Animate
simple SwiftUI animation, it’s initialized by closure
Sequential
sequential animations running one after another
Parallel
parallel animations running simultaneously
Interval
time interval
Instant
any block of code, always zero duration
TimerAnimation
CADisplayLink
wrapperInteractive
method
.start()
or.delegate()
returnsAnimationDelegateProtocol
objectAnimationDelegateProtocol
.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
,CALayer
andView
,Binding
extension to describe an animation of propertiesTransitions
VDAnimation provides easy way to describe
UIViewController
transitions. VDAnimation also supports transitions like Keynote’sMagic Move
orHero
. 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.Installation
Add the following line to your Podfile:
and run
pod update
from the podfile directory first.Create a
Package.swift
file.Author
dankinsoid, voidilov@gmail.com
License
VDAnimation is available under the MIT license. See the LICENSE file for more info.