<!--
{
  "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/UITableViewDataSource/tableView(_:numberOfRowsInSection:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITableViewDataSource(im)tableView:numberOfRowsInSection:"
  },
  "title" : "tableView(_:numberOfRowsInSection:)"
}
-->

# tableView(_:numberOfRowsInSection:)

Tells the data source to return the number of rows in a given section of a table view.

```
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
```

## Parameters

`tableView`

The table-view object requesting this information.

`section`

An index number identifying a section in `tableView`.

## Return Value

The number of rows in `section`.

## Discussion

---

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)