<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSTextViewportLayoutControllerDelegate/viewportBounds(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextViewportLayoutControllerDelegate(im)viewportBoundsForTextViewportLayoutController:"
  },
  "title" : "viewportBounds(for:)"
}
-->

# viewportBounds(for:)

Returns the current viewport, which is the view visible bounds plus the overdraw area.

```
func viewportBounds(for textViewportLayoutController: NSTextViewportLayoutController) -> CGRect
```

## Parameters

`textViewportLayoutController`

The [`NSTextViewportLayoutController`](/documentation/UIKit/NSTextViewportLayoutController).

## Return Value

A <doc://com.apple.documentation/documentation/CoreFoundation/CGRect>.

---

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)