Just as the question\'s title mentions:
What\'s the difference between \"cellForRowAtIndexPath\" and \"willDisplayCell: forRowAtIndexPath
I faced an issue with cell configuration in willDisplayCell: when used autolayout and UITableViewAutomaticDimension. The heights of reused cells didn't calculate properly. Printing methods in NSLog shows that willDisplayCell: is called after heightForRowAtIndexPath: (tested on iOS 10.2 simulator)
cellForRowAtIndexPath: {length = 2, path = 1 - 0}
heightForRowAtIndexPath: {length = 2, path = 1 - 0}
heightForRowAtIndexPath: {length = 2, path = 1 - 0}
willDisplayCell: {length = 2, path = 1 - 0}
cellForRowAtIndexPath: {length = 2, path = 1 - 1}
heightForRowAtIndexPath: {length = 2, path = 1 - 1}
heightForRowAtIndexPath: {length = 2, path = 1 - 1}
willDisplayCell: {length = 2, path = 1 - 1}
I think this was the reason, because problem has gone after placing configuration code in cellForRowAtIndexPath:
P.S. There is an opposite article to the link and quote posted by @iTSangar: https://tech.zalando.com/blog/proper-use-of-cellforrowatindexpath-and-willdisplaycell/