1

Most social network apps using UITableViewCell I've observed have a minimum of 3 rows in each section. The rows come in different sizes, with usually the first row containing the users details and the time they've posted the content. The second row contains the content posted with an image or text, and the last row contain further options such as the like button, follow button, share button, etc.

What is the best way to create such a cell?

stevekohls
  • 2,214
  • 23
  • 29
Martin Q
  • 403
  • 1
  • 6
  • 13

2 Answers2

0

What I would do is I would create a custom cell in an nib file and then in the custom cell .Swift file all you would have to do is declare all the outlets. To implement this custom cell I would recommend taking a look at this stack question Custom UITableViewCell from nib in Swift

Community
  • 1
  • 1
Stefan DeClerck
  • 1,162
  • 2
  • 12
  • 22
0

Some approaches:

  1. Footer and Header

Section: users details and the time cell: content posted with an image or text footer: further options such as the like button, follow button, share button

  1. Only Cell

You can do it using only cell. You can create a base cell (title [details and the time] and bottom buttons[like button, follow button, share button]) and subclass 2 others: image cell , text only cell , etc..

  1. Many tables (worst option)

You still can use this option. Basically you will have 1 section for each post and inside this section will have one UITableView (with 3 cells[header, content, footer])

I have been using "Only Cell" approach

Klevison
  • 3,342
  • 2
  • 19
  • 32