<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPageControl/size(forNumberOfPages:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIPageControl(im)sizeForNumberOfPages:"
  },
  "title" : "size(forNumberOfPages:)"
}
-->

# size(forNumberOfPages:)

Returns the size the receiver’s bounds should be to accommodate the given number of pages.

```
func size(forNumberOfPages pageCount: Int) -> CGSize
```

## Parameters

`pageCount`

The number of pages to fit in the receiver’s bounds.

## Return Value

The minimum size required to display dots for the page count.

## Discussion

Subclasses that customize the appearance of the page control can use this method to resize the page control when the page count changes.

---

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)