FetchedResultsController

public class FetchedResultsController<T: NSManagedObject>

A type safe wrapper around an NSFetchedResultsController

  • The NSFetchRequest being used by the FetchedResultsController

    Declaration

    Swift

    public var fetchRequest: NSFetchRequest<T>
  • Subscript access to the sections

    Declaration

    Swift

    public subscript(indexPath: IndexPath) -> T { return internalController.object(at: indexPath) }
  • The objects that match the fetch request

    Declaration

    Swift

    public var fetchedObjects: [T]?
  • The first object matching the fetch request

    Declaration

    Swift

    public var first: T?
  • The number of objects matching the fetch request

    Declaration

    Swift

    public var count: Int
  • The number of sections matching the fetch request

    Declaration

    Swift

    public var sectionCount: Int
  • The sections returned by the FetchedResultsController see FetchedResultsSectionInfo

    Declaration

    Swift

    public var sections: LazyMapCollection<[NSFetchedResultsSectionInfo], FetchedResultsSectionInfo<T>>?
  • The name of the file used to cache section information.

    Declaration

    Swift

    public var cacheName: String?
  • The NSIndexPath for a specific object in the fetchedObjects

    Declaration

    Swift

    public func indexPathForObject(_ object: T) -> IndexPath?