<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGContext/setDestination(_:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "c:@F@CGPDFContextSetDestinationForRect"
  },
  "title" : "setDestination(_:for:)"
}
-->

# setDestination(_:for:)

Sets a destination to jump to when a rectangle in the current PDF page is clicked.

```
func setDestination(_ name: CFString, for rect: CGRect)
```

## Parameters

`name`

A destination name.

`rect`

A rectangle that specifies an area of the current page of a PDF graphics context. The rectangle is specified in default user space (not device space).

## 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)