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

Authored by featherless on Apr 20 2017, 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
Branch
noop (branched from develop)
Lint
Lint OK
Unit
Unit Tests OK
featherless created this revision.Apr 20 2017, 2:28 PM
Restricted Application added a reviewer: O2: Material Motion. · View Herald TranscriptApr 20 2017, 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.Apr 20 2017, 7:36 PM
markwei added a subscriber: markwei.
markwei added inline comments.
examples/ChangeDirectionOnReleaseExample.swift
45

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.Apr 20 2017, 7:36 PM
featherless marked an inline comment as done.Apr 21 2017, 4:57 PM
featherless added inline comments.
examples/ChangeDirectionOnReleaseExample.swift
45

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.