---
title: "init(keyPath:type:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uiinterpolatingmotioneffect/init(keypath:type:)"
---

# init(keyPath:type:)

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

## Declaration

```swift
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 doc://com.apple.uikit/documentation/UIKit/UIView/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 doc://com.apple.uikit/documentation/UIKit/UIInterpolatingMotionEffect/EffectType.

## Return Value

Return Value An initialized interpolating motion effect object.

## See Also

### Initializing a motion effect

- [init(coder:)](uikit/uiinterpolatingmotioneffect/init(coder:).md)
