Fix bug with Tossable being used with TransitionSpring instances.
ClosedPublic

Authored by featherless on Mar 8 2017, 3:38 PM.

Details

Summary

Possible scenario (in the contextual transition demo):

  1. Use a TransitionSpring with Tossable.
  2. Prime Draggable with an existing gesture recognizer that is active.
  3. Dismiss the photo with a drag.

Expected behavior: the photo tracks the drag's movement.
Actual behavior: the photo jumps to the final position and then starts translating.

This was happening because Draggable was reading the final value of the view before TransitionSpring had a chance to set the proper initial value, causing Draggable's initialValue to be polluted with the wrong value.

After this fix, springs will always initialize the initial state before draggable reads its initial state.

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.Mar 8 2017, 3:38 PM
markwei accepted this revision.Mar 8 2017, 3:51 PM
This revision is now accepted and ready to land.Mar 8 2017, 3:51 PM
This revision was automatically updated to reflect the committed changes.