<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Ref",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s3RefV"
  },
  "title" : "Ref"
}
-->

# Ref

A safe reference allowing in-place reads to a shared value.

```
@frozen struct Ref<Value> where Value : ~Copyable
```

## Topics

### Initializers

[`init(borrowing Value)`](/documentation/Swift/Ref/init(_:))

Initializes an instance of `Ref` with the given borrowed value. This
creates a constant reference to that value preventing writes on the
original value while this reference is still active.

[`init<Owner>(unsafeAddress: UnsafePointer<Value>, borrowing: borrowing Owner)`](/documentation/Swift/Ref/init(unsafeAddress:borrowing:))

Unsafely initializes an instance of `Ref` using the given
‘unsafeAddress’ as the reference based on the borrowed lifetime of the
given ‘owner’ argument.

### Instance Properties

[`var value: Value`](/documentation/Swift/Ref/value)

Dereferences the constant reference allowing for in-place reads to the
underlying value.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Copyable`](/documentation/Swift/Copyable)

[`Sendable`](/documentation/Swift/Sendable)

---

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)