When no gesture recognizer is provided to a gestural interaction that expects one, the interaction now does nothing.
ClosedPublic

Authored by featherless on Thu, Apr 20, 2:28 PM.

Details

Summary

Gestural interactions configured to expect a gesture recognizer will no longer connect any streams if a gesture recognizer is not provided.

The withFirstGestureIn: now uses this new behavior when it can't find a gesture recognizer that qualifies for the interaction. Prior to this change, if the withFirstGestureIn initializer couldn't find a gesture recognizer it would default to registerNewRecognizerToTargetView behavior. This can cause superfluous gesture recognizers to be registered to a 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.Thu, Apr 20, 2:28 PM
Restricted Application added a reviewer: O2: Material Motion. · View Herald TranscriptThu, Apr 20, 2:28 PM
Restricted Application added a project: Material Motion. · View Herald Transcript
Restricted Application added a reviewer: O4: Material Apple platform reviewers. · View Herald Transcript
Restricted Application added a reviewer: Material Motion. · View Herald Transcript
markwei accepted this revision.Thu, Apr 20, 7:36 PM
markwei added a subscriber: markwei.
markwei added inline comments.
examples/ChangeDirectionOnReleaseExample.swift
45 ↗(On Diff #10832)

according to your diff summary, I would expect you to be able to pass a null gesture into ChangeDirection, and for that interaction to no-op.

This revision is now accepted and ready to land.Thu, Apr 20, 7:36 PM
featherless marked an inline comment as done.Fri, Apr 21, 4:57 PM
featherless added inline comments.
examples/ChangeDirectionOnReleaseExample.swift
45 ↗(On Diff #10832)

Good call - fixed.

featherless marked an inline comment as done.
  • Make all gestural operators support optional gesture recognizers.
This revision was automatically updated to reflect the committed changes.