nxtbgthng / UITableView-NXEmptyView

An easy way to add empty views to your table view without subclassing anything
Other
205 stars 28 forks source link

Bad performance of swizzling `nxEV_layoutSubviews` #13

Open ludwigschubert opened 10 years ago

ludwigschubert commented 10 years ago

I'm not too sure why this is a problem, but Instruments showed me that 90+% of computation in my table view during simply scrolling was spent in the swizzled nxEV_layoutSubviews method.

Sorry I couldn't investigate further, but thought it was worth letting you know. Thanks in concept for the extension, though! :D

markgaensicke commented 9 years ago

Yes, I think this is because UIKit very frequently calls layoutSubviews during scrolling. The swizzled layoutSubviews method then calls nxEV_updateEmptyView which leads to the performance problems you've mentioned.