<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSView/scrollToVisible(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSView(im)scrollRectToVisible:"
  },
  "title" : "scrollToVisible(_:)"
}
-->

# scrollToVisible(_:)

Scrolls the view’s closest ancestor [`NSClipView`](/documentation/AppKit/NSClipView) object the minimum distance needed so a specified region of the view becomes visible in the clip view.

```
func scrollToVisible(_ rect: NSRect) -> Bool
```

## Parameters

`rect`

The rectangle to be made visible in the clip view.

## Discussion

<doc://com.apple.documentation/documentation/Swift/true> if any scrolling is performed; otherwise returns <doc://com.apple.documentation/documentation/Swift/false>.

## See Also

[`func scroll(to: NSPoint)`](/documentation/AppKit/NSClipView/scroll(to:))

Changes the origin of the clip view’s bounds rectangle to `newOrigin`.

[`func isDescendant(of: NSView) -> Bool`](/documentation/AppKit/NSView/isDescendant(of:))

Returns a Boolean value that indicates whether the view is a subview of the specified view.



---

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)