Rework the gestural interactions to use constant properties where applicable.
ClosedPublic

Authored by featherless on Wed, Mar 1, 2:14 PM.

Details

Summary

Draggable/Rotatable/Scalable all share the same base type now.

The default behavior of these interactions is now to register a new gesture recognizer to the target view.

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 1, 2:14 PM
Restricted Application completed building Restricted Buildable.Wed, Mar 1, 2:14 PM
featherless edited the summary of this revision. (Show Details)Wed, Mar 1, 2:14 PM
chuga requested changes to this revision.Wed, Mar 1, 4:58 PM
chuga added a subscriber: chuga.
chuga added inline comments.
src/interactions/Gesturable.swift
25 ↗(On Diff #10132)

this needs documentation

35 ↗(On Diff #10132)

I find the use of "next" here a little confusing as it implies that there's an order or sequence of them, but I don't have a better suggestion atm :(

58 ↗(On Diff #10132)

Naming here could be improved, gestureRecognizer(targetView reactiveView: ReactiveUIView) would be a better alternative imo.
Also, should the reactiveView be optional? why would it be mandatory for the other configs? or those shouldn't be calling prepareToAdd?

src/interactions/Tap.swift
29

nit: what about using default values for these as nil and have a single init?

This revision now requires changes to proceed.Wed, Mar 1, 4:58 PM
featherless marked 3 inline comments as done.Thu, Mar 2, 12:29 PM
featherless added inline comments.
src/interactions/Gesturable.swift
35 ↗(On Diff #10132)

I've made it a property to better indicate that it's a cached value.

58 ↗(On Diff #10132)

Renamed to follow more of a queue metaphor.

featherless marked 2 inline comments as done.
  • Add docs.
  • Make a property.
  • Queue.
featherless marked an inline comment as done.Thu, Mar 2, 12:30 PM
featherless added inline comments.
src/interactions/Tap.swift
29

This gets reworked in a follow-up diff.

chuga accepted this revision.Thu, Mar 2, 1:11 PM
This revision is now accepted and ready to land.Thu, Mar 2, 1:11 PM
This revision was automatically updated to reflect the committed changes.
featherless marked an inline comment as done.