klevison/KMAccordionTableViewController

How to show different data in tableview controller of section 4

Closed this issue · 2 comments

I learned how to dynamically create sections.

Now i am stuck at how to display different data in each section tableviewcontroller

For example I have 4 sections and each section contains a tableviewcontroller. Now i want to display different data in each of it.

You need to create a view for each section and attach view to section:

UIView *viewOfSection = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 100)];
//you can add any UI object in this view [viewOfSection addSubview:bla bla] 
KMSection *section = [KMSection new];
section.view = viewOfSection;

if you want to show UITableViewController then you need to init UITableViewController and attach view to section:

UITableViewController * mycontroller = [storyboard instantiateViewControllerWithIdentifier:@"MyTableView"];
KMSection *section = [KMSection new];
section.view = mycontroller.view;

@kelvinonik mind sharing how you dynamically create the sections??

Thank you