An object that maps the horizontal or vertical tilt of a device to values that you specify so that UIKit can apply those values to your views.


class UIInterpolatingMotionEffect : UIMotionEffect


You use this class to determine the amount of tilt along a single axis to apply to a view. After creating an instance of this class, you must assign appropriate values to the minimumRelativeValue and maximumRelativeValue properties. As the user moves the device, the motion effect object translates the fixed offset values returned by the system (which are in the range -1 to 1) to the range of values you specified. UIKit then applies the translated values to any target views.


Initializing a Motion Effect

init(keyPath: String, type: UIInterpolatingMotionEffect.EffectType)

Initializes and returns an interpolating motion effect object configured for the specific tilt direction.

Accessing the Motion Attributes

var keyPath: String

The key path you want to modify on the view.

var minimumRelativeValue: Any?

The value that maps to the minimum viewer offset.

var maximumRelativeValue: Any?

The value that maps to the maximum viewer offset.


enum UIInterpolatingMotionEffect.EffectType

The axis to use when interpolating values.


Inherits From

Conforms To

See Also

View-Based Effects

class UIMotionEffectGroup

A collection of motion effects that you want to apply to a view at the same time.