Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve draw performance #17

Closed
ndleon09 opened this issue Dec 13, 2016 · 4 comments
Closed

Improve draw performance #17

ndleon09 opened this issue Dec 13, 2016 · 4 comments

Comments

@ndleon09
Copy link
Contributor

Call the draw method inside tableView:willDisplayCell:forRowAtIndexPath: method instead tableView:cellForRowAtIndexPath: method.

Don’t perform data binding at tableView:willDisplayCell:forRowAtIndexPath: method, because there’s no cell on screen yet. For this you can use tableView:willDisplayCell:forRowAtIndexPath: method which can be implemented in the delegate of UITableView. The method called exactly before showing cell in UITableView’s bounds.

What do you think?

@adellibovi
Copy link
Member

I already read that article some time ago and made some research, this is actually a "person thought" and not official by Apple. There were some tests by another article (https://tech.zalando.com/blog/proper-use-of-cellforrowatindexpath-and-willdisplaycell) replying to the one you are quoting that proved that at the moment there is no performance gain.

@adellibovi
Copy link
Member

Maybe let's leave this issue open for a while if someone can prove that in iOS 10 something changed

@ndleon09
Copy link
Contributor Author

Yeah, at the end of article, the author say:
Note: With iOS10, willDisplayCell and cellForRowAtIndexPath call orders will be changed. I will follow up with another article about the changes in iOS10 in the near future.

@adellibovi
Copy link
Member

Closing this since we don't have any update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants