Accessing table view controller from UITableViewDiffableDataSource subclass

With diffable data sources you have to subclass UITableViewDiffableDataSource to support cell editing. What would be a good approach to performing an operation in the parent controller from that overridden method?


I'm adopting diffable data sources within a previous table view controller I have that supports cell deletions. Up until now I simply implemented the tableView(_:commit:forRowAt:) delegate callback. With diffable data sources to achieve the same behavior however, I have to subclass `UITableViewDiffableDataSource` and override it there instead. I'm not sure what would be a good approach to performing an operation in the table view controller from within that delegate callback, like updating CloudKit records for example.


I don't think the difference in how to support cell editing is documented, but in Apple's Using Collection View Compositional Layouts and Diffable Data Sources sample code you'll see it in a `WiFiSettingsViewController` extension.

Accessing table view controller from UITableViewDiffableDataSource subclass
 
 
Q