In case the new predicate change amount of items, collection view crashed:
2017-05-12 11:23:26.192 SwiftDemo[12755:330575] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (14) must be equal to the number of items contained in that section before the update (16), plus or minus the number of items inserted or deleted from that section (10 inserted, 10 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).'
To repeat this issue just add to Swift Demo project inside one of CollectionViewController:
In case the new predicate change amount of items, collection view crashed:
2017-05-12 11:23:26.192 SwiftDemo[12755:330575] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (14) must be equal to the number of items contained in that section before the update (16), plus or minus the number of items inserted or deleted from that section (10 inserted, 10 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).'
To repeat this issue just add to Swift Demo project inside one of CollectionViewController:
Possible solution (rollback "Safer UICollection reloading") in Merge Request — https://github.com/SyncDB/DATASource/pull/103