PTPopoverTableViewController
@interface PTPopoverTableViewController
: UIViewController <UITableViewDelegate, UITableViewDataSource>
A UITableViewController replacement designed to work well in a popover presentation.
Functionality replicated from UITableViewController includes:
- Creates a table view with the correct dimensions and autoresizing, setting the
dataSourceanddelegateto self. - In
-viewWillAppear:, it reloads the table’s data if it’s empty. Otherwise, it deselects all rows (with or without animation) if clearsSelectionOnViewWillAppear is YES. - In
-viewDidAppear:, it flashes the table’s scroll indicators. - Implements
-setEditing:animated:to toggle the editing state of the table view. - Sets the
preferredContentSizeto reflect thecontentSizeandcontentInsetof the table view.
Unlike the UITableViewController class, this view controller class does NOT adjust the contentInset
of the table view when the virtual keyboard is shown.
-
Initializes a
PTPopoverTableViewControllerinstance with the specified table view style.Declaration
Objective-C
- (nonnull instancetype)initWithStyle:(UITableViewStyle)style;Swift
init(style: UITableView.Style)Parameters
styleThe style to use for the table view
Return Value
an initialized
PTPopoverTableViewControllerinstance -
Initializes a
PTPopoverTableViewControllerinstance with the specified coder.Declaration
Objective-C
- (nullable instancetype)initWithCoder:(nonnull NSCoder *)coder;Swift
init?(coder: NSCoder)Parameters
coderThe coder for initialization
Return Value
an initialized
PTPopoverTableViewControllerinstance, ornilif decoding failed -
The table view used by this view controller.
Declaration
Objective-C
@property (nonatomic, strong, null_resettable) UITableView *tableView;Swift
var tableView: UITableView! { get set } -
Whether the table view’s selection should be cleared when
-viewWillAppear:is called.The default value of this property is
YES.Declaration
Objective-C
@property (nonatomic) BOOL clearsSelectionOnViewWillAppear;Swift
var clearsSelectionOnViewWillAppear: Bool { get set } -
Undocumented
Declaration
Objective-C
- (instancetype)initWithNibName:(nullable NSString *)nibName bundle:(nullable NSBundle *)nibBundle NS_UNAVAILABLE;
PTPopoverTableViewController Class Reference