CSListSectionObserver
@available(OSX 10.12, *)
@objc
public protocol CSListSectionObserver : CSListObjectObserver
Implement the CSListSectionObserver
protocol to observe changes to a list’s section info. CSListSectionObserver
s may register themselves to a CSListMonitor
‘s -addListSectionObserver:
method:
CSListMonitor *monitor = [CSCoreStore
monitorSectionedListFrom:[CSFrom entityClass:[MyPersonEntity class]]
sectionBy:[CSSectionBy keyPath:@"age"]
fetchClauses:@[[CSOrderBy sortDescriptor:[CSSortKey withKeyPath:@"lastName" ascending:YES]]]];
[monitor addListSectionObserver:self];
See also
ListSectionObserver
-
Notifies that a section was inserted at the specified index
Declaration
Swift
@objc optional func listMonitor(_ monitor: CSListMonitor, didInsertSection sectionInfo: NSFetchedResultsSectionInfo, toSectionIndex sectionIndex: Int)
Parameters
monitor
the
CSListMonitor
monitoring the list being observedsectionInfo
the
NSFetchedResultsSectionInfo
for the inserted sectionsectionIndex
the new section index for the new section
-
Notifies that a section was inserted at the specified index
Declaration
Swift
@objc optional func listMonitor(_ monitor: CSListMonitor, didDeleteSection sectionInfo: NSFetchedResultsSectionInfo, fromSectionIndex sectionIndex: Int)
Parameters
monitor
the
CSListMonitor
monitoring the list being observedsectionInfo
the
NSFetchedResultsSectionInfo
for the deleted sectionsectionIndex
the previous section index for the deleted section