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

  • SEARCH
  • Home
  • 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 7042669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:11:47+00:00 2026-05-28T02:11:47+00:00

I have an array which contains 2 types of items (lets call them type

  • 0

I have an array which contains 2 types of items (lets call them type a and type b) which are to be displayed in a table view.

The table view can be filtered such that either just items of type a are displayed, or just items of type b, or all items are displayed and the user can control which filtering is applied by hitting one of 3 corresponding tabs.

So this suggests that my app’s root controller should be a tab bar controller.

If that were the only requirement then I would make the tab bar controller have 3 table view controllers, however there is another requirement that I don’t know how to design it in a clean way:

If there are no items to be displayed for any of the filters then instead of an empty table view there should be displayed an image and some text (the image and text is different depending upon which filter is selected). So maybe this could have been achieved by setting background images for the table view BUT if filter a is applied then in addition to the images/text a button should also be displayed – which I am assuming cannot be set as the background to a table view. Hence implying that I need a set of separate view controllers to handle displaying the image/text/button views.

I suppose I could have the tab bar controller dynamically swap in and out these view controllers with the table view controllers depending upon if there are items to display for each filter or not, but this seems messy.

So then I was thinking maybe the tab bar controller should own 3 navigation controllers, and each navigation controller has as its root view controller a controller to display the image/text/button if there are no items, otherwise it would push a table view controller onto its stack (and pop it off if the number of items goes down to 0).

Is this a valid option? Is there a canonical pattern for my described behaviour?

TIA

  • 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-28T02:11:47+00:00Added an answer on May 28, 2026 at 2:11 am

    This is actually fairly easy. Use a UITabBarController as your main interface. The view controller for each tab will be a subclass of UIViewController with a UITableView. Each table view controller will load the data appropriate for the its tab. If each tab behaves the same (other than the filter) then this works great as your logic will be in one controller implementation. If you need different behavior per tab, no big deal, customize as needed.

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

Sidebar

Related Questions

I have an array which contains around 50-200 hyperlinks. How can I pass this
I have a scroll view, which contains about 40-50 objects of different types. The
I have a MySQL table which contains the following type of information: Date product
i have an array which contains only 2 types of numbers(x and x-1) eg:-
I have an array of type Person, which contains string objects: FirstName, LastName, login.
I have a table form which contains a part where the rows can be
I have an array which contains another array Would I notate it this way?
Am I missing something in the Array documentation? I have an array which contains
I have an array DetailsArray in VB.NET which contains the result of a LINQ
I have a plist which contains an array of NSDictionary 's which represent a

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.