3

I am pretty new to iOS application development (primarily a game developer so I use Unity more than anything) ... So I have been searching for this answer in multiple places and perhaps I dont even really know how to properly ask it but I will try and explain what I am trying to accomplish.

Goal: I have an app that has a newsfeed with a variety of topics posted to the newsfeed, when you tap into a topic it brings you to a page with more information on said topic and then has all the updates that were fed into the newsfeed on that topic posted underneath in order from most recent.

My Question: Do I have to combine viewcontrollers to accomplish this? For the newsfeed I am using the TableViewController but for this specific example the "top" part of this page is a long description of a topic. Then all the updates are fed beneath that. Could this also possibly just be a tableview again with multiple sections?

Very Old Prototype Image, for example of what trying to accomplish

I really just dont know how to accomplish this but I know its possible because multiple applications have topics and have comments fed beneath them so I cant imagine self posted updates are different... but I dont fully understand what kind of view those apps use to accomplish that either.

ANY guidance would be greatly appreciated.

2 Answers2

1

Looks like your best bet is a single UITableViewController with a different cell types and custom section headers. Each cell type is a separate view that "knows" how to display the specific type of data - this question was already answered here. Here is some info on custom section headers.

Community
  • 1
  • 1
C0D3LIC1OU5
  • 8,600
  • 2
  • 37
  • 47
1

You can just make every entry of yours a cell, and just have sections for the top part and the updates part.

First, you will need to set Headers for your sections. That can be set using the headerForSection tableView() method. See this for more.

Then if you are going for the exact look you have in your mockup, I would suggest subclassing a UITableViewCell and customizing it so that it can look however you want it to look like. To customize a cell, just make a prototype cell in your UITableViewController storyboard, and set it's class to whatever you call your cell subclass. There are a lot of resources online that can help.

Since all your entries/updates look the same, then you can just use your customized cell for whatever you need.

JoeVictor
  • 1,806
  • 1
  • 17
  • 38