0

I want to create a dynamic list just like the one in Slack, specifically the Channels, which updates with which channels you're a part of: Slack

However, I have no idea where to start. While I'm using the SWRevealViewController Library, it only has a static table in the examples, not a dynamic one. While I'm working through this apple documentation, it's still not specific to interacting with SWRevealViewController, which I would prefer, although I certainly wouldn't mind a non-SWRevealViewController method. I'd definitely appreciate some tips to head in the right direction! All my view controllers show up properly right now, so I'm in the process of adding information to them.

Somewhat related:

Set UITableView Delegate and DataSource

UITableView issue when using separate delegate/dataSource

Creating A TableVIew Programmatically With Objective-C iOS

Community
  • 1
  • 1

1 Answers1

0

You may use this tutorial to create such menu:

http://www.appcoda.com/ios-programming-sidebar-navigation-menu/

You have only to substitute those static UITableViewController with dynamic. You may easily find how to create dynamic. Its body will be something like this one:

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    // Return the number of rows in the section.
    return menuItems.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    NSString *CellIdentifier = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

    return cell;
}
Yuri Chukhlib
  • 120
  • 11
  • Just the kind of reply I was looking for!! Thank you! –  Aug 10 '15 at 01:03
  • I'm going through the guide and while learning the storyboards method is definitely useful, the app I'm working for is doing everything via programming. Do you have any pure-code guides? –  Aug 10 '15 at 03:02
  • @BlackBox Unfortunately no. I had to create something similar to yours, and it was the best tutorial. – Yuri Chukhlib Aug 10 '15 at 09:27
  • No problem! I'll figure out how to do it programming :) –  Aug 10 '15 at 22:21