Complex Navigation in Titanium, Part 2

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!

This entry was posted in Mobile Development, Titanium. Bookmark the permalink.

7 Responses to Complex Navigation in Titanium, Part 2

  1. Mike says:

    Looks nice!

  2. Jens says:

    Great Stuff.

  3. Dave says:

    Considering “createNavigationGroup” gets discontinued in 3.2.0, is it as straight forward as switching over to “Titanium.UI.iOS.NavigationWindow” for these cross platform navigation controllers? Had a quick go and it doesn’t seem to work with the new method.

    • sunfishgurl says:

      Hi Dave,
      Yes, the NavigationController is broken as of Ti 3.2. I’m working on fixing it within my time and schedule constraints (it is an open source project after all, :) ). However, if you or someone else would like to come up with a solution and share it with all of us, we would be very grateful! If anything changes, I’ll be sure to post the update here.
      Best, Vui

  4. Pingback: Cross Platform Nav Controller Compatible with Ti 3.2 | Sunfish Empire LLC: Mobile Solution Provider

Comments are closed.