---
title: "pointer(to:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/unsafemutablepointer/pointer(to:)-8cyek"
---

# pointer(to:)

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

## Declaration

```swift
func pointer<Property>(to property: KeyPath<Pointee, Property>) -> UnsafePointer<Property>?
```

## Parameters

- `property`: A KeyPath whose Root is Pointee.

## Return Value

Return Value A pointer to the stored property represented by the key path, or nil.

## Discussion

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