Material Motion Exploring solutions that will empower creators with the tools needed to describe and implement rich, interactive motion on any platform. Edit this page · History
$._map xLockedTo
Status Interface level Implementation level Library
Proposed as of March 30, 2016 L2: Interaction creator L3: Stream creator material-motion
UpdatesCurrent StatusInitiation dateCompletion date
First proposed Stable March 30, 2017
iOS (Swift) View View
upstream (Point)
xValue (number)
(Point) downstream

xLockedTo specification

This is the engineering specification for the MotionObservable operator: xLockedTo.


xLockedTo sets the upstream point’s x value to the provided value and emits the result.

Example usage

stream.xLocked(to: 50)

upstream  xValue  |  downstream
20, 50    50      |  50, 50
40, 80    50      |  50, 80
60, 90    50      |  50, 90


Expose an xLockedTo operator API

Use _map to implement the operator. Accept an xValue number. Emit {xValue, upstream.y}.

class MotionObservable<number> {
  public func xLocked(to xValue: number) -> MotionObservable<Point>