Contents

init(keyPath:type:)

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

Declaration

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

Parameters

  • keyPath:

    The key path of the view that you want to modify. This path must correspond to an animatable property of the view on which this motion effect is applied. For example, to update the Center property of the view, specify the string “center”.

  • type:

    The type of motion to track. You can track horizontal or vertical tilt. For a list of possible values, see Effecttype.

Return Value

An initialized interpolating motion effect object.

See Also

Initializing a motion effect