UITableViewController
The UITableViewController class creates a controller object that manages a table view. It implements the following behavior:
More...
Inheritance
-
NSObject -
UIResponder -
UIViewController -
UITableViewController
-
NSObject -
UIResponder -
UIViewController -
UITableViewController
Conforms To
-
AnyObject -
NSCoding -
NSExtensionRequestHandling -
NSObjectProtocol -
UIAppearanceContainer -
UIContentContainer -
UIScrollViewDelegate -
UIStateRestoring -
UITableViewDataSource -
UITableViewDelegate -
UITraitEnvironment -
NSCoding -
NSObject -
UIAppearanceContainer -
UIContentContainer -
UITableViewDataSource -
UITableViewDelegate -
UITraitEnvironment
Import Statement
import UIKit
@import UIKit;
Availability
Available in iOS 2.0 and later.
-
Initializes a table-view controller to manage a table view of a given style.
Declaration
Swift
init(stylestyle: UITableViewStyle)Objective-C
- (instancetype)initWithStyle:(UITableViewStyle)styleParameters
styleA constant that specifies the style of table view that the controller object is to manage (
UITableViewStylePlainorUITableViewStyleGrouped).Return Value
An initialized
UITableViewControllerobject ornilif the object couldn’t be created.Discussion
If you use the standard
initmethod to initialize aUITableViewControllerobject, a table view in the plain style is created.Import Statement
import UIKitAvailability
Available in iOS 2.0 and later.
-
Returns the table view managed by the controller object.
Declaration
Swift
var tableView: UITableView!Objective-C
@property(nonatomic, retain) UITableView *tableViewImport Statement
import UIKitAvailability
Available in iOS 2.0 and later.
-
A Boolean value indicating if the controller clears the selection when the table appears.
Declaration
Swift
var clearsSelectionOnViewWillAppear: BoolObjective-C
@property(nonatomic) BOOL clearsSelectionOnViewWillAppearDiscussion
The default value of this property is
YEStrue. WhenYEStrue, the table view controller clears the table’s current selection when it receives aviewWillAppear:message. Setting this property toNOfalsepreserves the selection.Import Statement
import UIKitAvailability
Available in iOS 3.2 and later.
-
The refresh control used to update the table contents.
Declaration
Swift
var refreshControl: UIRefreshControl?Objective-C
@property(nonatomic, retain) UIRefreshControl *refreshControlDiscussion
The default value of this property is
nil.Assigning a refresh control to this property adds the control to the view controller’s associated interface. You do not need to set the frame of the refresh control before associating it with the view controller. The view controller updates the control’s height and width and sets its position appropriately.
The table view controller does not automatically update table’s contents in response to user interactions with the refresh control. When the user initiates a refresh operation, the control generates a
UIControlEventValueChangedevent. You must associate a target and action method with this event and use them to refresh your table’s contents.Import Statement
import UIKitAvailability
Available in iOS 6.0 and later.
Copyright © 2014 Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: 2012-09-19
