<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITableView/automaticDimension",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@UITableViewAutomaticDimension"
  },
  "title" : "automaticDimension"
}
-->

# automaticDimension

A constant representing the default value for a given dimension.

```
class let automaticDimension: CGFloat
```

## Discussion

Return this value from your table view’s delegate methods when you want the table view to choose a default value for the given dimension. For example, if you return this constant from [`tableView(_:heightForHeaderInSection:)`](/documentation/UIKit/UITableViewDelegate/tableView(_:heightForHeaderInSection:)) or [`tableView(_:heightForFooterInSection:)`](/documentation/UIKit/UITableViewDelegate/tableView(_:heightForFooterInSection:)), the table view uses a height that fits the value returned from [`tableView(_:titleForHeaderInSection:)`](/documentation/UIKit/UITableViewDataSource/tableView(_:titleForHeaderInSection:)) or [`tableView(_:titleForFooterInSection:)`](/documentation/UIKit/UITableViewDataSource/tableView(_:titleForFooterInSection:)), if the title is not `nil`.

---

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)