// Errors on [indexPath!] and [newIndexPath!] ---- the message "Cannot convert value of type 'NSIndexPath?' to expected element type 'Array<IndexPath>.ArrayLiteralElement' (aka 'IndexPath')"
func controller(controller:
NSFetchedResultsController<NSFetchRequestResult>, didChangeObject
anObject: AnyObject, atIndexPath indexPath: NSIndexPath?,
forChangeType type: NSFetchedResultsChangeType, newIndexPath:
NSIndexPath?) {
switch(type) {
case .insert:
self.heroTableView.insertRowsAtIndexPaths([newIndexPath!],
withRowAnimation: .fade)
case .delete:
self.heroTableView.deleteRowsAtIndexPaths([indexPath!],
withRowAnimation: .fade)
default:
()
}
}