iOS - newsfeed structure: does Instagram use TableViews inside of TableCells?

StackOverflow https://stackoverflow.com/questions/23625817

  •  21-07-2023
  •  | 
  •  

質問

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