Open sourcing the Storehouse animation engine
In building Storehouse, we wanted to make your photos and videos feel eminently touchable, with creation and consumption experiences designed from the ground up for mobile. The rich animations and interactions found throughout the app are powered by a custom animation engine that we call “Advance.” It uses dynamic animations — including springs — to bring a sense of realism to the way the UI moves and feels.
Today I’m excited to release Advance as an open source project.
The project contains a sample app that demonstrates some of the things you can build with Advance:
The API
It’s 100% Swift, and looks like this:
// Animate value types directly0.0.animateTo(3.0, duration: 2.0, timingFunction: LinearTimingFunction()) { (value) in
// Do something with value
}
And like this:
// Wrap values in Animatable<Type> to support animated changes.let point = Animatable(value: CGPoint.zero)point.changed.observe { (value) in
// Do something every time the center value changes
}point.springTo(CGPoint(width: 200.0, height: 200.0)
// or...
// foo.center.animateTo(...)
// foo.center.decay(...)
// foo.center.animate(<custom animation type>)
And like this:
// Wrap value in Spring<Type> for convenient access to a spring simulation.let s = Spring(value: CGPoint.zero)
s.changed.observe { (value) in
// do something with the value when it changes
}
s.target = CGPoint(x: 100.0, y: 200.0)
This is a beta release.
Advance is launching as version 0.9.
While it’s been used in production for some time, many of the APIs were cleaned up over the last few weeks (inevitably introducing new issues)— I’m looking forward to bug reports to help us get to 1.0.
And, of course, I’m excited to hear about what you love, what you hate, and (most of all) what you build with Advance!