xmartlabs / XLMailBoxContainer

Custom container view controller ala MailBox app.
MIT License
89 stars 15 forks source link

self.title is not showing on tab bar #12

Open fpaaske opened 9 years ago

fpaaske commented 9 years ago

My app has this structure:

tabbarcontroller 
    -> navigation controller -> tableviewcontroller
    -> navigation controller -> viewcontroller
    -> navigation controller -> XLSwipeContainerController
    -> navigation controller -> etc

I can set title on every controller and it will show correctly on the tab, except for the XLSwipeContainerController. Currently I have subclassed it and loading the embedded controllers from a storyboard, then I set title (self.title+ self.navigationController.title + self.tabBarItem.title) after calling [super initWithViewControllers]. This doesn't work.

I have narrowed it down to a difference in calling [super initWithCoder] vs [super initWithNib] and created a workaround by adding a new initializer, initWithViewControllers:(NSArray *)viewControllers andCoder:(NSCoder *)aDecoder, which will call [super initWithCoder].

This seems to solve the problem, however, I feel like it should be possible when doing initWithNib as well. Am I missing something?