swift - How many rows an iOS table view should contain when I use pagination? -


i have load news inside table view.

i know have use pagination or lazy loading, because there may thousands of news @ point.

my question is:

if have instance 10000 news, should return number inside:

func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int     {         return totalnumberofnews     } 

?

or, maybe should return smaller number, let's 200-300, , whenever user scrolls , down reset offset of table view

i know cells reused, , never keep 10000 cells in memory. wondering if return 10000 or 1 million in method affect performance in way.

thanks in advance!

you use count of news articles you've downloaded. user scrolls down, @ point request more, add them existing news articles, , reload table view sees new count.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -