I am just starting ios development with IOS 5 and storyboards and would like to know how I can solve the following problem:
I have a tree hierarchy with categories an products being nodes of the tree and products are leaves. I created a TileViewController view to display all nodes at a specific level. When the user selects a node in the TileView, depending on its type (leaf or not-leaf) I either push a new TileViewController into the application NavigationController or I show a DetailViewController.
What I do currently is to do everything programmatically(By that I mean tracking what the user clicked on in the TileViewController and decide what to push next in the NavigationController). I get a handle on the storyboard and use the below code to create the next TileViewController if needed.
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
TileViewController *controller = [storyBoard instantiateViewControllerWithIdentifier:@"TileViewController"];
controller.model = self.model;
[self.navigationController pushViewController:controller animated:YES];
What I can't figure out is how to make this using a storyboard instead of hardcoding logic in the TileViewController. Is this at all possible? I thought about using a single TileViewController and just reloading the tiles displayed based on the user selection but then I lose the navigation piece. Any ideas how I could achieve this?
Thank you.