Slide 121
Slide 121 text
How to build transitions
// Building a transition
class PushBackTransition: Transition {
func willBegin(ctx: TransitionContext, runtime: MotionRuntime) {
let offscreen = ctx.height + ctx.fore.height / 2
let onscreen = ctx.center.y
runtime.add(TransitionSpring(back: offscreen, fore: onscreen,
direction: ctx.direction)
to: ctx.fore.positionY)
runtime.add(TransitionSpring(back: 1, fore: 0.95,
direction: ctx.direction),
to: ctx.back.scale)
}
}