Learn how to affect components’ reactions to device motion and scrolling.
- Apple News Format
- Apple News API
In Apple News Format, a behavior defines the physics of a component and its context and determines how a component responds to user actions. A behavior can specify the gravitational effect of a component or how the component reacts to the motion of the device. For example, a behavior can move the background of a component slightly more slowly than the user is scrolling.
Apple News Format has these behaviors for components:
BackgroundMotion. Causes the background of a component to move in the opposite direction from the motion of the device.
BackgroundParallax. Causes the background of a component to move slightly more slowly than the user’s scroll speed.
Motion. Causes a component to react to movement of the device.
Parallax. Causes a component to move at a specific speed.
Springy. Causes a component to act as if it is held in place with a short spring.
A behavior is different from an animation. A behavior is persistent and always in effect as long as the user is viewing the article. An animation occurs only once each time the user views the article. See About Component Animations.