ArthurDevNL/AHTabBarController

Usage in multiple Storyboard apps : A Question

Closed this issue · 3 comments

For multiple storyboards, I really like your ToDo: "Instead of setting the StoryboardID of a viewcontroller add the possibility to add the viewcontroller directly to the tab."

If TabBarController reloadViewForItem:(AHSubitemView *)subitem is modified, would this be sufficient, or would something else break?

Thanx in Advance

The best part about using view-controller identifiers is that when the app receives a memory warning it can release all non-visible controllers and reinstatiate them from storyboard if necessary.

Therefore, you should not only modify -reloadViewForItem: but also the -didReceiveMemoryWarning method so that it only releases the view-controllers that can be reinstantiated.

Thanks for getting back to me.
Scenario,
Say I have 4 tabs, but each is driven by a different storyboard.
What’s the best way to handle this?

That’s the gist of my question

Thanx again,

On Nov 25, 2014, at 3:38 PM, ArthurDevNL notifications@github.com wrote:

The best part about using view-controller identifiers is that when the app receives a memory warning it can release all non-visible controllers and reinstatiate them from storyboard if necessary.

Therefore, you should not only modify -reloadViewForItem: but also the -didReceiveMemoryWarning method so that it only releases the view-controllers that can be reinstantiated.


Reply to this email directly or view it on GitHub #2 (comment).

At the moment I instantiate a subitem's view-controller as following:

    viewController = [self.storyboard instantiateViewControllerWithIdentifier:subitem.viewControllerIdentifier];

If you want to use different storyboards for different subitems you could add a storyboard property to the AHSubitemView and change the above line of code to:

    viewController = [subitem.storyboard instantiateViewControllerWithIdentifier:subitem.viewControllerIdentifier];

Or you could make it even better and just create a -viewController instance method on an AHSubitemView. But either way you'll have to set the storyboard when setting up your AHTabBarController.