This repository has been archived by the owner on Nov 24, 2021. It is now read-only.
Swift release
- 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 😊