<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSView/convert(_:to:)-6u9ir",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSView(im)convertPoint:toView:"
  },
  "title" : "convert(_:to:)"
}
-->

# convert(_:to:)

Converts a point from the view’s coordinate system to that of a given view.

```
func convert(_ point: NSPoint, to view: NSView?) -> NSPoint
```

## Parameters

`point`

A point specifying a location in the coordinate system of the view.

`view`

The view into whose coordinate system `point` is to be converted. Both `view` and the view must belong to the same [`NSWindow`](/documentation/AppKit/NSWindow) object, and that window must not be `nil`. If `view` is `nil`, this method converts to window coordinates instead.

## Return Value

The point converted to the coordinate system of `aView`.

## See Also

[`contentView`](/documentation/AppKit/NSWindow/contentView)

The window’s content view, the highest accessible view object in the window’s view hierarchy.

[`-  ancestorSharedWithView:`](/documentation/AppKit/NSView/ancestorShared(with:))

Returns the closest ancestor shared by the view and another specified view.



---

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)