Happy new year, dear readers! Boy, do I have a nice new year’s present for you.
In a previous blog post, I talked about the challenges of managing a stack of windows in a single screen in Titanium. In this post, I take things a step further. This time, I improve upon the NavigationController framework that I wrote. Also, I wrote a mobile app that, while not highly interesting, does illustrate the use of the NavigationController in a more complex app. The Bananas app is a master detail app that goes several levels deep, particularly through the Bananas (hence the name of the app) and Grapes items.
As an added bonus, I added the ability to create windows within the NavigationController file itself. This comes in handy if the attributes and/or styling for the base window of each platform is different, so you don’t have to write branching code to check the platform each time you create a window, and you don’t have to pass the type of window into every file you call, either. Although you still have to pass the NavigationController object everywhere, at least that’s only one object you have to pass around instead of two. One may ask: why not just make the NavigationController object a global variable? Because I’ve tried to do that, and it didn’t work, plus the Appcelerator tutorials say that’s a big no-no.
Check out the code on github here and watch the videos. Being that this is an open source project, I may not have time to update this project very often. However, please feel free to fork from the project, make your own changes, and comment on what you did below. I’d love to hear from you. Enjoy!