I'm making newsfeed for my iOS app which is very similar to Instagram.

How does Instagram group its photos and comments in one long table? It seems most logical to me to put TableViews into TableCells of parent TableView.

So child TableView inside of TableCell will contain: username in row 1, photo in row 2, +3 last comments in remaining rows.

And it will be easy to calculate number of rows for parent table. It will be = [feeds count].

But I've read that it's bad idea to put TableView into TableCell.

So should I use one big flat table (why)? Calculating number of rows in numberOfRowsInSection will be more complicated then as well as determining what to show in cellForRowAtIndexPath...

有帮助吗?

解决方案

It seems to me they're using a section for each photo, with a header view for avatar, location, date and username, and a custom footer view for each section which contains the like/comment button, as well as the comments and likes already on the post. If I were to make instagram, that's the way I would go.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top