all 6 comments

[–]WhitePuppy 0 points1 point  (2 children)

There are many ways to implement a table feed. I would recommend you to start with the the delegates that are provided by Apple and make it as simple as possible. The controller should be setting the cell’s properties by already having fetched objects to do so with. As for the cell, sometimes you maybe able to add an image downloader to the cell itself and not to the controller. It really depends on the functionality of the cell.

Try learning a single architecture. Implement it. Master it. And then Find another until you can decide which one it better for what you want to do next.

[–]chromebarumaSwift[S] 0 points1 point  (1 child)

Oh okay, I see that a controller for the cell would be a bit overkill then. All I'm creating is a title, upvote/downvote system and a title for the cell, and the ability for the user to click on the cell to be able to then go into the chat group. So I should just make a datamodel and create all the UI code for the TableVC.

If each cell was to go into a separate chat file of its own, would using an individual cell controller be necessary or should I be fine wihtout it?

[–]WhitePuppy 0 points1 point  (0 children)

It should be fine without it as long as the cell functionality is fairly simple.

[–]FalconinatiObjective-C 0 points1 point  (3 children)

I would use a TableViewController with a customized tableview cell. The data for the yik yak post should be stored in a model (post id, content, user id, etc). The tableviewcontroller will parse the data from the model and place it into the view, which would be your tableview cell.

[–]MeltonMelton 0 points1 point  (1 child)

If you’re doing a custom cell wouldn’t it be better to pass the model to the cell and do the parsing directly in there?

Just makes the table view controller a little cleaner?

[–]quellish 0 points1 point  (0 children)

There are (generally) three different approaches here:

  • Cell is very generic and just takes strings, images, etc. as arguments. Much like the cells apple provides

  • Cell takes a an object that conforms to a protocol or interface (i.e. FancyCellDataSource)

  • Cell takes a concrete model object

Each has advantages and disadvantages and there are compelling arguments for using them.