---
title: "viewportBounds(for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nstextviewportlayoutcontrollerdelegate/viewportbounds(for:)"
---

# viewportBounds(for:)

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

## Declaration

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

## Parameters

- `textViewportLayoutController`: The doc://com.apple.uikit/documentation/UIKit/NSTextViewportLayoutController.

## Return Value

Return Value A CGRect.

## See Also

### Responding to changes in the viewport

- [textViewportLayoutController(_:configureRenderingSurfaceFor:)](uikit/nstextviewportlayoutcontrollerdelegate/textviewportlayoutcontroller(_:configurerenderingsurfacefor:).md)
- [textViewportLayoutControllerDidLayout(_:)](uikit/nstextviewportlayoutcontrollerdelegate/textviewportlayoutcontrollerdidlayout(_:).md)
- [textViewportLayoutControllerWillLayout(_:)](uikit/nstextviewportlayoutcontrollerdelegate/textviewportlayoutcontrollerwilllayout(_:).md)
- [textViewportLayoutControllerReceivedSetNeedsLayout(_:)](uikit/nstextviewportlayoutcontrollerdelegate/textviewportlayoutcontrollerreceivedsetneedslayout(_:).md)
