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];
  • 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 observed

    sectionInfo

    the NSFetchedResultsSectionInfo for the inserted section

    sectionIndex

    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 observed

    sectionInfo

    the NSFetchedResultsSectionInfo for the deleted section

    sectionIndex

    the previous section index for the deleted section