TableEditingController
public struct TableEditingController<DataSource> where DataSource : DataSourceProtocol
An instance of TableEditingController allows editing a table view via inserting and deleting rows.
-
Asks if a row at the specified index path is editable for the specified table view.
Declaration
Swift
public typealias CanEditRowConfig = (DataSource.Item?, UITableView, IndexPath) -> BoolParameters
itemThe item at
indexPath.tableViewThe table view requesting this information.
indexPathThe index path of the item.
Return Value
trueif the specified row is editable,falseotherwise. -
Commits the editing actions for the specified index path.
Declaration
Swift
public typealias CommitEditingConfig = (inout DataSource, UITableView, UITableViewCell.EditingStyle, IndexPath) -> VoidParameters
dataSourceThe dataSource at
indexPath.tableViewThe table view being edited.
commitThe editing style.
indexPathThe index path of the item.
-
A closure that determines if a given row is editable.
Declaration
Swift
public let canEditRow: CanEditRowConfig -
A closure that commits the editing actions for a table view.
Declaration
Swift
public let commitEditing: CommitEditingConfig
-
Constructs a new
TableEditingController.Declaration
Swift
public init(canEditRow: @escaping CanEditRowConfig, commitEditing: @escaping CommitEditingConfig)Parameters
canEditRowThe closure that determines if a given row is editable.
commitEditingThe closure that commits the editing actions for a table view.
Return Value
A new
TableEditingControllerinstance.
View on GitHub
TableEditingController Structure Reference