mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-21 17:09:42 +01:00
ListObserver's listMonitorDidChange(_:) and listMonitorDidRefetch(_:) handlers are now required.
This commit is contained in:
@@ -56,8 +56,7 @@ public protocol ListObserver: class {
|
|||||||
func listMonitorWillChange(_ monitor: ListMonitor<ListEntityType>)
|
func listMonitorWillChange(_ monitor: ListMonitor<ListEntityType>)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Handles processing right after a change to the observed list occurs. (Optional)
|
Handles processing right after a change to the observed list occurs. (Required)
|
||||||
The default implementation does nothing.
|
|
||||||
|
|
||||||
- parameter monitor: the `ListMonitor` monitoring the object being observed
|
- parameter monitor: the `ListMonitor` monitoring the object being observed
|
||||||
*/
|
*/
|
||||||
@@ -65,17 +64,16 @@ public protocol ListObserver: class {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
This method is broadcast from within the `ListMonitor`'s `refetch(...)` method to let observers prepare for the internal `NSFetchedResultsController`'s pending change to its predicate, sort descriptors, etc. (Optional)
|
This method is broadcast from within the `ListMonitor`'s `refetch(...)` method to let observers prepare for the internal `NSFetchedResultsController`'s pending change to its predicate, sort descriptors, etc. (Optional)
|
||||||
The default implementation does nothing.
|
|
||||||
- Note: The actual refetch will happen after the `NSFetchedResultsController`'s last `controllerDidChangeContent(_:)` notification completes
|
|
||||||
|
|
||||||
|
- Important: All `ListMonitor` access between `listMonitorWillRefetch(_:)` and `listMonitorDidRefetch(_:)` will raise and assertion. The actual refetch will happen after the `NSFetchedResultsController`'s last `controllerDidChangeContent(_:)` notification completes.
|
||||||
- parameter monitor: the `ListMonitor` monitoring the object being observed
|
- parameter monitor: the `ListMonitor` monitoring the object being observed
|
||||||
*/
|
*/
|
||||||
func listMonitorWillRefetch(_ monitor: ListMonitor<ListEntityType>)
|
func listMonitorWillRefetch(_ monitor: ListMonitor<ListEntityType>)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
After the `ListMonitor`'s `refetch(...)` method is called, this method is broadcast after the `NSFetchedResultsController`'s last `controllerDidChangeContent(_:)` notification completes. (Optional)
|
After the `ListMonitor`'s `refetch(...)` method is called, this method is broadcast after the `NSFetchedResultsController`'s last `controllerDidChangeContent(_:)` notification completes. (Required)
|
||||||
The default implementation does nothing.
|
|
||||||
|
|
||||||
|
- Important: When `listMonitorDidRefetch(_:)` is called it should be assumed that all `ListMonitor`'s previous data have been reset, including counts, objects, and persistent stores.
|
||||||
- parameter monitor: the `ListMonitor` monitoring the object being observed
|
- parameter monitor: the `ListMonitor` monitoring the object being observed
|
||||||
*/
|
*/
|
||||||
func listMonitorDidRefetch(_ monitor: ListMonitor<ListEntityType>)
|
func listMonitorDidRefetch(_ monitor: ListMonitor<ListEntityType>)
|
||||||
@@ -89,11 +87,7 @@ public extension ListObserver {
|
|||||||
|
|
||||||
public func listMonitorWillChange(_ monitor: ListMonitor<ListEntityType>) { }
|
public func listMonitorWillChange(_ monitor: ListMonitor<ListEntityType>) { }
|
||||||
|
|
||||||
public func listMonitorDidChange(_ monitor: ListMonitor<ListEntityType>) { }
|
|
||||||
|
|
||||||
public func listMonitorWillRefetch(_ monitor: ListMonitor<ListEntityType>) { }
|
public func listMonitorWillRefetch(_ monitor: ListMonitor<ListEntityType>) { }
|
||||||
|
|
||||||
public func listMonitorDidRefetch(_ monitor: ListMonitor<ListEntityType>) { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user