1

I am developing an e-Commerce mobile application and I have a SWRevealViewController implemented to get a Slide Out Menu. When a web service call is made, I get a JSOn object containing categories and its sub categories. So, when I click a cell containing a category, I would like to to show its sub category cells by expanding.

How can I go about making this?

Thanks in advance

Samarth
  • 43
  • 6
  • Probably similar question already asked before [here](http://stackoverflow.com/questions/30489632/how-to-create-category-and-subcategory-selection-in-uitableview-in-ios-objective) – MrWaqasAhmed Apr 07 '16 at 06:16
  • I want it to contain cells it self.. not a view. Tap on a cell and show cells – Samarth Apr 07 '16 at 06:17
  • one simple and easy way is to use a section header with titles as categories and rows as the sub categories, wherever the user taps the section header open subcategory and taps again hide the subcategory by reloading the sections – Shankar BS Apr 07 '16 at 06:18
  • Use the sample code provided in my answer for table view setup you are using in SWRevealViewController , just configured you table view with Exemptible table view for menu and get the result, you might need to modify the code, log the issue on git hub if you face any – Tarun Seera Apr 07 '16 at 06:37

3 Answers3

1

I have created one sample code for this feature where you can expand you table view cell upto multilevel. and its easily configured with NSDictionary

Source code Link Expandible Table View

Sample Screen Shot enter image description here

https://github.com/tarunseera/ExpandibleTableView

Tarun Seera
  • 4,212
  • 4
  • 27
  • 41
0

You can use the expandable tableview, some third party libraries are available for this,

Just Refer this link->Expandable Tableview

Use the following delegate methods to expand and dismiss

- (void)tableView:(SLExpandableTableView *)tableView downloadDataForExpandableSection:(NSInteger)section
{
    // download your data here
    // call [tableView expandSection:section animated:YES]; if download was successful
    // call [tableView cancelDownloadInSection:section]; if your download was NOT successful
}

- (void)tableView:(SLExpandableTableView *)tableView didExpandSection:(NSUInteger)section animated:(BOOL)animated
{
  //...
}

- (void)tableView:(SLExpandableTableView *)tableView didCollapseSection:(NSUInteger)section animated:(BOOL)animated
{
  //...
}
RJV Kumar
  • 2,408
  • 1
  • 19
  • 28
0

try this out Expandable TableView

Pratik Jamariya
  • 810
  • 1
  • 10
  • 35