<!--
{
  "availability" : [
    "macOS: 10.8.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPageControllerDelegate/pageController(_:frameFor:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSPageControllerDelegate(im)pageController:frameForObject:"
  },
  "title" : "pageController(_:frameFor:)"
}
-->

# pageController(_:frameFor:)

Returns the frame appropriate for displaying the specified object.

```
@MainActor optional func pageController(_ pageController: NSPageController, frameFor object: Any?) -> NSRect
```

## Parameters

`pageController`

The page controller.

`object`

The object to display.

## Return Value

The frame appropriate for displaying `object`.

## Discussion

You only need to implement this if the view frame can differ between the page controller’s [`arrangedObjects`](/documentation/AppKit/NSPageController/arrangedObjects).

This method must return immediately. Avoid file, network or any potentially blocking or lengthy work to provide an answer.

If this method is not implemented, all [`arrangedObjects`](/documentation/AppKit/NSPageController/arrangedObjects) are assumed to have the same frame as the `pageController` object’s current [`selectedViewController`](/documentation/AppKit/NSPageController/selectedViewController) instance’s `view` or the bounds of `view` when [`selectedViewController`](/documentation/AppKit/NSPageController/selectedViewController) is `nil`.

This method is only useful if [`pageController(_:identifierFor:)`](/documentation/AppKit/NSPageControllerDelegate/pageController(_:identifierFor:)) and [`pageController(_:viewControllerForIdentifier:)`](/documentation/AppKit/NSPageControllerDelegate/pageController(_:viewControllerForIdentifier:)) are implemented.

---

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)