Class

UIInterpolatingMotionEffect

A UIInterpolatingMotionEffect object maps the horizontal or vertical tilt of a device to values that you specify so that UIKit can apply those values to your views. You use this class to determine the amount of tilt along a single axis to apply to a view.

Overview

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.

Symbols

Initializing a Motion Effect

init(keyPath: String, type: UIInterpolatingMotionEffectType)

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 type: UIInterpolatingMotionEffectType

The tilt direction to monitor.

var minimumRelativeValue: Any?

The value that maps to the minimum viewer offset.

var maximumRelativeValue: Any?

The value that maps to the maximum viewer offset.

Constants

UIInterpolatingMotionEffectType

The axis to use when interpolating values.

Relationships

Inherits From