<!--
{
  "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/UITableViewController",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITableViewController"
  },
  "title" : "UITableViewController"
}
-->

# UITableViewController

A view controller that specializes in managing a table view.

```
@MainActor class UITableViewController
```

## Overview

Subclass [`UITableViewController`](/documentation/UIKit/UITableViewController) when your interface consists of a table view and little or no other content. Table view controllers already adopt the protocols you need to manage your table view’s content and respond to changes. In addition, [`UITableViewController`](/documentation/UIKit/UITableViewController) implements the following behaviors:

- Automatically loads the table view archived in a storyboard or nib file, which you can access using the [`tableView`](/documentation/UIKit/UITableViewController/tableView) property
- Sets the data source and the delegate of the table view to `self`
- Implements the [`viewWillAppear(_:)`](/documentation/UIKit/UIViewController/viewWillAppear(_:)) method, automatically reloads the data for its table view on first appearance, and clears its selection (with or without animation, depending on the request) every time the table view appears (disable this last behavior by changing the value of [`clearsSelectionOnViewWillAppear`](/documentation/UIKit/UITableViewController/clearsSelectionOnViewWillAppear))
- Implements the [`viewDidAppear(_:)`](/documentation/UIKit/UIViewController/viewDidAppear(_:)) method and automatically flashes the table view’s scroll indicators when it first appears
- Implements the [`setEditing(_:animated:)`](/documentation/UIKit/UIViewController/setEditing(_:animated:)) method and automatically toggles the edit mode of the table when the user taps an Edit|Done button in the navigation bar
- Automatically resizes its table view to accommodate the appearance or disappearance of the onscreen keyboard

Create a custom subclass of [`UITableViewController`](/documentation/UIKit/UITableViewController) for each table view that you manage. When you initialize the table view controller, you must specify the style of the table view (plain or grouped). You must also override the data source and delegate methods required to fill your table with data. You may override [`loadView()`](/documentation/UIKit/UIViewController/loadView()) or any other superclass method, but if you do, be sure to invoke the superclass implementation of the method, usually as the first method call.

## Topics

### Creating a table view controller

[`-  initWithStyle:`](/documentation/UIKit/UITableViewController/init(style:))

Initializes a table view controller to manage a table view of a given style.

[`-  initWithNibName:bundle:`](/documentation/UIKit/UITableViewController/init(nibName:bundle:))

Creates a table view controller with the nib file in the specified bundle.

[`-  initWithCoder:`](/documentation/UIKit/UITableViewController/init(coder:))

Creates a table view controller from data in an unarchiver.

### Getting the table view

[`tableView`](/documentation/UIKit/UITableViewController/tableView)

Returns the table view managed by the controller object.

### Configuring the table behavior

[`clearsSelectionOnViewWillAppear`](/documentation/UIKit/UITableViewController/clearsSelectionOnViewWillAppear)

A Boolean value indicating if the controller clears the selection when the table appears.

### Refreshing the table view

[`refreshControl`](/documentation/UIKit/UITableViewController/refreshControl)

The refresh control used to update the table contents.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`UIAppearanceContainer`](/documentation/UIKit/UIAppearanceContainer)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Hashable`](/documentation/Swift/Hashable)

[`UITraitEnvironment`](/documentation/UIKit/UITraitEnvironment)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`UIStateRestoring`](/documentation/UIKit/UIStateRestoring)

[`UITableViewDelegate`](/documentation/UIKit/UITableViewDelegate)

[`UIUserActivityRestoring`](/documentation/UIKit/UIUserActivityRestoring)

[`UIFocusEnvironment`](/documentation/UIKit/UIFocusEnvironment)

[`UIContentContainer`](/documentation/UIKit/UIContentContainer)

[`UITraitChangeObservable-67e94`](/documentation/UIKit/UITraitChangeObservable-67e94)

[`UITableViewDataSource`](/documentation/UIKit/UITableViewDataSource)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`UIScrollViewDelegate`](/documentation/UIKit/UIScrollViewDelegate)

[`UIActivityItemsConfigurationProviding`](/documentation/UIKit/UIActivityItemsConfigurationProviding)

[`UIPasteConfigurationSupporting`](/documentation/UIKit/UIPasteConfigurationSupporting)

[`UIResponderStandardEditActions`](/documentation/UIKit/UIResponderStandardEditActions)

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSExtensionRequestHandling`](/documentation/Foundation/NSExtensionRequestHandling)

### Inherits From

[`UIViewController`](/documentation/UIKit/UIViewController)

---

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)