Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1036147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:39:18+00:00 2026-05-16T14:39:18+00:00

I would just like to clarify that by ‘design’, I mean software design, not

  • 0

I would just like to clarify that by ‘design’, I mean software design, not UI design.

I have an application similar to the native settings app. The problem I have with it is it doesn’t follow the same clear-cut MVC style. Other apps tend to focus around displaying one kind of thing. In the case of a periodic table app for example, it’s elements. The elements clearly comprise the model, and they share similar properties and behaviours, meaning they can be displayed and interacted with identically. An app like this almost designs itself!

My app, like the settings apps, consists of an arbitrary selection of rows displaying dissimilar data in dissimilar ways. One row might contain a switch, the other might modally present a very specific view when tapped. They’re all very different.

How do you design something like this?

At the moment, I’m doing it all in the view controller, and the relevant rows are being tracked via an enum:

enum {
    kNameRow,
    kGenderRow,
    kJobTypeRow,
    kLevelOfExerciseRow,
    kEmailAddressRow,
    kTelephoneNumberRow
};

As I described, these cells are all very different, so displaying cells is handled like this:

// - tableView:cellForRowAtIndexPath pseudocode.

switch (indexPath.row) {
    case kNameRow: // create name cell.
    case kGenderRow: // create gender cell.
    case kJobTypeRow: // create job type cell.
    case kLevelOfExerciseRow: // create level of exercise cell.
    case kEmailAddressRow: // create email address cell.
    case kTelephoneNumberRow: // create telephone number cell.
}

And interacting with cells is handled similarly:

// - tableView:didSelectRowAtIndexPath pseudocode.

switch (indexPath.row) {
    case kNameRow: // do name-specific stuff.
    case kGenderRow: // do gender-specific stuff.
    case kJobTypeRow: // do job type-specific stuff.
    case kLevelOfExerciseRow: // do level of exercise-specific stuff.
    case kEmailAddressRow: // do email address-specific stuff.
    case kTelephoneNumberRow: // do telephone number-specific stuff.
}

This seems hugely unwieldy, and has the added of problem of not working when the table is broken down into multiple sections.

Is there a better way to do this? Are there any design patterns I would benefit from using when working with big tables of largely unrelated data?

Any tips at all are hugely appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:39:19+00:00Added an answer on May 16, 2026 at 2:39 pm

    I’ve become fond of implementing section controllers that pull the logic out of you UITableViewController subclass (or other hosting controller) and move them into self-contained classes.

    I ended up implementing a base protocol that defines what a section controller needs to do – for me, that includes the number of rows in a section and a cell for the row (don’t need the whole index path since the controller deals with a single section). I’ve got optional method for returning a section name and row height. That’s all I’ve implemented so far since that’s all I’ve actually needed.

    It works for me because my individual sections tend to be homogeneous, but you could easily use the idea to return heterogeneous cells within the same section or refactor the idea to have cell type controllers instead of section controllers. In the end, my UITableViewDelegate and UITableViewDataSource methods just need to figure out which section controller to call instead of embedded all the logic within the UITableViewController subclass.

    I think I got the idea from this article, but I also saw a more recent article that describes the same idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just like Carl's question over here I would like to ask you (because I
I would like to add a typing speed indicator just below the textarea we
I would like to be able to manipulate the DOM just before my page
I would like to implement an interactive evolutionary algorithm for generating music (probably just
I would like to execute multiple commands in a row: i.e. (just to illustrate
I thought that to clone a List you would just call: List<int> cloneList =
When starting out with a new application, would you rather just use an existing
Just wondering how you would go about implementing something similar to stackoverflow'd related questions.
I'm using the asp:TreeView and would really rather just output it to a standard
How would I implement a binary search using just an array?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.