<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIInterpolatingMotionEffect/init(keyPath:type:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIInterpolatingMotionEffect(im)initWithKeyPath:type:"
  },
  "title" : "init(keyPath:type:)"
}
-->

# init(keyPath:type:)

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

```
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`](/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 [`UIInterpolatingMotionEffect.EffectType`](/documentation/UIKit/UIInterpolatingMotionEffect/EffectType).

## Return Value

An initialized interpolating motion effect object.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)