diff --git a/Sources/Observing/ListMonitor.swift b/Sources/Observing/ListMonitor.swift index ad96481..342f211 100644 --- a/Sources/Observing/ListMonitor.swift +++ b/Sources/Observing/ListMonitor.swift @@ -202,7 +202,7 @@ public final class ListMonitor: Hashable { !self.isPendingRefetch || Thread.isMainThread, "Attempted to access a \(cs_typeName(self)) outside the main thread while a refetch is in progress." ) - return (self.fetchedResultsController.fetchedObjects as? [T]) ?? [] + return self.fetchedResultsController.dynamicCast().fetchedObjects ?? [] } /** @@ -371,7 +371,7 @@ public final class ListMonitor: Hashable { !self.isPendingRefetch || Thread.isMainThread, "Attempted to access a \(cs_typeName(self)) outside the main thread while a refetch is in progress." ) - return (self.fetchedResultsController.fetchedObjects as? [T] ?? []).index(of: object) + return (self.fetchedResultsController.dynamicCast().fetchedObjects ?? []).index(of: object) } /**