Simplify the contextual transition demo.
ClosedPublic

Authored by featherless on Wed, Mar 8, 3:44 PM.

Details

Summary

Now makes use of Tossable as per the modal and interactive push back transition demos. This pattern has now been proven in three different transitions and can likely be formalized.

Diff Detail

Repository
rREACTIVEMOTIONSWIFT reactive-motion-swift
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
featherless created this revision.Wed, Mar 8, 3:44 PM
Restricted Application completed building Restricted Buildable.Wed, Mar 8, 3:44 PM
markwei accepted this revision.Wed, Mar 8, 3:50 PM
markwei added a subscriber: markwei.
markwei added inline comments.
examples/ContextualTransitionExample.swift
283–295

why does draggable have a *next* gesture recognizer? What does "next" signify?

302

this is an interesting API. Though just a special case of runtime.add(stream, gesture.enabled) right?

This revision is now accepted and ready to land.Wed, Mar 8, 3:50 PM
featherless added inline comments.Wed, Mar 8, 3:53 PM
examples/ContextualTransitionExample.swift
302

Yep. Starting to define higher-level variants of runtime.add.

featherless added inline comments.Wed, Mar 8, 3:55 PM
examples/ContextualTransitionExample.swift
283–295

Draggable might create its own gesture recognizer when it gets add'd. If we want to coordinate motion off of that gesture recognizer we need some way to access it. This was the simplest stop-gap solution I could come up with.

An alternative solution that I'd considered was allowing runtime.add to return a generic type. In this case Draggable could return a pan gesture recognizer. Happy to explore this in the future.

This revision was automatically updated to reflect the committed changes.