onmyway133 / DeepDiff

🦀Amazingly incredible extraordinary lightning fast diffing in Swift
https://onmyway133.com/apps/
Other
2.05k stars 145 forks source link

Bug with replacement animations still appearing #29

Open ValCanBuild opened 5 years ago

ValCanBuild commented 5 years ago

For some reason, even if you specify reload(replacementAnimations: .none) the tableView still updates the item with an animation the first time it replaces it.

It seems that stackoverflow suggests wrapping the reloadRows logic in a UIView.performWithoutAnimation {} ` block. Could you handle this case @onmyway133 ?

onmyway133 commented 5 years ago

@ValCanBuild Nice catch, not sure if this issue persists in certain iOS versions 🤔 do you want to submit a PR?

ValCanBuild commented 5 years ago

@onmyway133 it definitely happens in the latest iOS (12.1) so yes, it can. Come to think of it, though, not sure how safe my proposed change is cause what if the user wants to not have replacement animations but still do some animations when they rebind their data? If we just add a performWithoutAnimation as a fix on the library level we'll break that ability.

NikitaChugaynov commented 2 years ago

.none is not "without animation", it's a default animation case: https://developer.apple.com/documentation/uikit/uitableview/rowanimation/none