Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

5.0.1

Compare
Choose a tag to compare
@3lvis 3lvis released this 26 Oct 08:23
· 259 commits to master since this release
  • Added support for tvOS

Previously on 5.0.0

  • Rewritten in Swift, this has improved Swift compatibility by 78%*

Breaking changes

  • Moved parameters so it's more consistent
init(tableView: UITableView, fetchRequest: NSFetchRequest, mainContext: NSManagedObjectContext, sectionName: String? = default, configuration: (cell: UITableViewCell, item: NSManagedObject, indexPath: NSIndexPath) -> (), cellIdentifier: (indexPath: NSIndexPath) -> (String))

init(collectionView: UICollectionView, fetchRequest: NSFetchRequest, mainContext: NSManagedObjectContext, sectionName: String? = default, configuration: (cell: UICollectionViewCell, item: NSManagedObject, indexPath: NSIndexPath) -> (), cellIdentifier: (indexPath: NSIndexPath) -> (String))
  • Made fetchedResultsController private, added convenience methods to access its data
var objectsCount: Int { get }

var isEmpty: Bool { get }

var objects: [NSManagedObject] { get }

func objectAtIndexPath(indexPath: NSIndexPath) -> NSManagedObject?

func indexPathForObject(object: NSManagedObject) -> NSIndexPath?

func fetch()

Example:

if self.dataSource.isEmpty {
    // Is empty, do something
}
  • Random number, made up. I know Swift compatibility is better but I don't know for how much 😊