Use the right NSFetchedResultsControllerDelegate method. Fix for Delegate method not being called. (CoreDataObservable with no informations #307) (#310)

This commit is contained in:
Akshay Hegde 2016-11-07 02:16:48 +05:30 committed by Pedro Piñera Buendía
parent dfd492a5c9
commit 75322fa966

View File

@ -50,8 +50,8 @@ public class CoreDataObservable<T: NSManagedObject>: RequestObservable<T>, NSFet
// MARK: - NSFetchedResultsControllerDelegate
@nonobjc public func controller(controller: NSFetchedResultsController<NSFetchRequestResult>, didChangeObject anObject: AnyObject, atIndexPath indexPath: IndexPath?, forChangeType type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) {
public func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) {
switch type {
case .delete:
self.batchChanges.append(.delete(indexPath![0], anObject as! T))