<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/UnsafeMutablePointer/pointer(to:)-8veyb",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:Sp7pointer2toSpyqd__GSgs15WritableKeyPathCyxqd__G_tlF"
  },
  "title" : "pointer(to:)"
}
-->

# pointer(to:)

Obtain a mutable pointer to the stored property referred to by a key path.

```
func pointer<Property>(to property: WritableKeyPath<Pointee, Property>) -> UnsafeMutablePointer<Property>?
```

## Parameters

`property`

A `WritableKeyPath` whose `Root` is `Pointee`.

## Return Value

A mutable pointer to the stored property represented
by the key path, or `nil`.

## Discussion

If the key path represents a computed property,
this function will return `nil`.

---

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)