CSListSectionObserver
@available(OSX 10.12, *)
@objc
public protocol CSListSectionObserver : CSListObjectObserver
Implement the CSListSectionObserver protocol to observe changes to a list’s section info. CSListSectionObservers 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
monitorthe
CSListMonitormonitoring the list being observedsectionInfothe
NSFetchedResultsSectionInfofor the inserted sectionsectionIndexthe 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
monitorthe
CSListMonitormonitoring the list being observedsectionInfothe
NSFetchedResultsSectionInfofor the deleted sectionsectionIndexthe previous section index for the deleted section
View on GitHub
CSListSectionObserver Protocol Reference