<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ViewDimensions/subscript(explicit:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI14ViewDimensionsV8explicit14CoreFoundation7CGFloatVSgAA19HorizontalAlignmentV_tcip::OverloadGroup"
  },
  "title" : "subscript(explicit:)"
}
-->

# subscript(explicit:)

Gets the explicit value of the given horizontal alignment guide.

```
subscript(explicit guide: HorizontalAlignment) -> CGFloat? { get }
```

## Overview

Find the horizontal offset of a particular guide in the corresponding
view by using that guide as an index to read from the context:

```
.alignmentGuide(.leading) { context in
    context[.leading] - 10
}
```

This subscript returns `nil` if no value exists for the guide.

For information about using subscripts in Swift to access member
elements of a collection, list, or, sequence, see
[Subscripts](https://docs.swift.org/swift-book/LanguageGuide/Subscripts.html)
in *The Swift Programming Language*.

---

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)