Add visualize operator and remove runtime.visualize.
ClosedPublic

Authored by featherless on Apr 14 2017, 5:15 PM.

Details

Summary

The new operator can be used anywhere like so:

swift
runtime.add(tossable, to: view) { $0.visualize(in: runtime.visualizationView) }

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.Apr 14 2017, 5:15 PM
Restricted Application added a reviewer: O2: Material Motion. · View Herald TranscriptApr 14 2017, 5:15 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 15 2017, 2:48 AM
markwei added a subscriber: markwei.
markwei added inline comments.
src/operators/visualize.swift
45

instead of needing dedupe() at all, why not just compare the existing label.text with prefix+stringValue, and only animate highlight if the text would change? Then you don't need all the deduping logic.

This revision is now accepted and ready to land.Apr 15 2017, 2:48 AM
featherless marked an inline comment as done.Apr 17 2017, 1:10 PM
  • Add docs and simplify code.
markwei added inline comments.Apr 17 2017, 1:13 PM
src/operators/visualize.swift
45

You seem to be ignoring "prefix" in your comparison.

  • Remove example code.
This revision was automatically updated to reflect the committed changes.
featherless added inline comments.Apr 17 2017, 1:23 PM
src/operators/visualize.swift
45