mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-09-10 03:41:53 +02:00
WIP
This commit is contained in:
@@ -38,7 +38,7 @@ extension ListSnapshot {
|
||||
|
||||
public let sectionID: SectionID
|
||||
|
||||
public let itemIDs: [ItemID]
|
||||
public let itemIDs: [NSManagedObjectID]
|
||||
|
||||
|
||||
// MARK: RandomAccessCollection
|
||||
@@ -79,7 +79,7 @@ extension ListSnapshot {
|
||||
public subscript(position: Int) -> ObjectPublisher<O> {
|
||||
|
||||
let itemID = self.itemIDs[position]
|
||||
return self.context.objectPublisher(objectID: itemID)
|
||||
return self.context.objectPublisher(managedObjectID: itemID)
|
||||
}
|
||||
|
||||
public func index(_ i: Index, offsetBy distance: Int) -> Index {
|
||||
@@ -100,7 +100,7 @@ extension ListSnapshot {
|
||||
public subscript(bounds: Range<Index>) -> ArraySlice<Element> {
|
||||
|
||||
let itemIDs = self.itemIDs[bounds]
|
||||
return ArraySlice(itemIDs.map(self.context.objectPublisher(objectID:)))
|
||||
return ArraySlice(itemIDs.map(self.context.objectPublisher(managedObjectID:)))
|
||||
}
|
||||
|
||||
|
||||
@@ -126,6 +126,7 @@ extension ListSnapshot {
|
||||
}
|
||||
self.sectionID = sectionID
|
||||
self.itemIDs = listSnapshot.itemIDs(inSectionWithID: sectionID)
|
||||
.map({ $0.managedObjectID })
|
||||
self.context = context
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user