<!--
{
  "availability" : [
    "iOS: 12.2.0 -",
    "iPadOS: 12.2.0 -",
    "macCatalyst: 12.2.0 -",
    "macOS: 10.14.4 -",
    "tvOS: 12.2.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/UnsafeMutableBufferPointer/span",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:SrsRi_zrlE4spans4SpanVyxGvp"
  },
  "title" : "span"
}
-->

# span

A span over the elements of this buffer.

```
var span: Span<Element> { get }
```

## Return Value

A `Span` over the elements of this buffer.

## Discussion

The lifetime of the returned span matches the lifetime of the binding
which returns it. This lifetime is a convenience, as there can be
no enforcement that there is no concurrent write to the underlying memory.
The programmer must ensure that the memory remains allocated, initialized
and immutable for the lifetime of the returned span.

> Note: This property is unsafe because it cannot guarantee that the
> underlying memory remains valid and immutable for the lifetime of
> the returned span.

> Complexity: O(1)

---

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)