The documentation for beginUpdates()
and endUpdates()
state to “Use the performBatchUpdates(_:completion:)
method instead of this one whenever possible.” So I thought it would be better to go with alternate implementation of NSFetchedResultsControllerDelegate
that does not implement controllerWillChangeContent(_:)
and controllerDidChangeContent(_:)
, and instead calls performBatchUpdates(_:completion:)
in controller(_:didChange:at:for:newIndexPath:)
and controller(_:didChange:atSectionIndex:for:)
. Turns out, that results in an invalid number of rows
exception when adding a new section. Since I can’t delete this post, I thought I’d at least provide an explanation in case anyone else had this idea. ¯\_(ツ)_/¯