<!--
{
  "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/move()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:SpsRi_zrlE4movexyF"
  },
  "title" : "move()"
}
-->

# move()

Retrieves and returns the referenced instance, returning the pointer’s
memory to an uninitialized state.

```
func move() -> Pointee
```

## Return Value

The instance referenced by this pointer.

## Discussion

Calling the `move()` method on a pointer `p` that references memory of
type `T` is equivalent to the following code, aside from any cost and
incidental side effects of copying and destroying the value:

```
let value: T = {
    defer { p.deinitialize(count: 1) }
    return p.pointee
}()
```

The memory referenced by this pointer must be initialized. After calling
`move()`, the memory is uninitialized.

---

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)