<!--
{
  "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/UISnapBehavior/init(item:snapTo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISnapBehavior(im)initWithItem:snapToPoint:"
  },
  "title" : "init(item:snapTo:)"
}
-->

# init(item:snapTo:)

Initializes a snap behavior with a dynamic item and a snap point.

```
init(item: any UIDynamicItem, snapTo point: CGPoint)
```

## Parameters

`item`

The dynamic item that you want to apply a snap behavior to.

`point`

The point that you want the dynamic item to snap to. The coordinate system for the `point` parameter depends on how you initialize the dynamic animator you’re adding the snap behavior to, as described in the overview of [`UIDynamicAnimator`](/documentation/UIKit/UIDynamicAnimator).

## Return Value

The initialized snap behavior, or `nil` if there was a problem initializing the object.

## Discussion

At the conclusion of a snap, the rotation value (as indicated by the [`transform`](/documentation/UIKit/UIDynamicItem/transform) property) for a dynamic item is `0`.

---

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)