DiffableDataSource.CollectionView implementation

This commit is contained in:
John Estropia
2019-10-16 14:01:25 +09:00
parent 7932625644
commit 64a0264354
14 changed files with 383 additions and 90 deletions

View File

@@ -183,7 +183,7 @@ class ListObserverDemoViewController: UITableViewController {
ColorsDemo.stack.perform(
asynchronous: { (transaction) in
transaction.delete(palette?.object)
transaction.delete(palette)
},
completion: { _ in }
)

View File

@@ -16,13 +16,13 @@ class ObjectObserverDemoViewController: UIViewController, ObjectObserver {
func setPalette<O: ObjectRepresentation>(_ newValue: O?) where O.ObjectType == Palette {
guard self.monitor?.cs_id() != newValue?.cs_id() else {
guard self.monitor?.objectID() != newValue?.objectID() else {
return
}
if let newValue = newValue {
self.monitor = ColorsDemo.stack.monitorObject(newValue)
self.monitor = newValue.asObjectMonitor(in: ColorsDemo.stack)
}
else {

View File

@@ -48,7 +48,7 @@ struct SwiftUIView: View {
)
}
.onDelete { itemIndices in
let objectsToDelete = self.palettes[section: sectionID, itemIndices: itemIndices].map({ $0.object })
let objectsToDelete = self.palettes[section: sectionID, itemIndices: itemIndices]
self.dataStack.perform(
asynchronous: { transaction in