weissi/FRLayeredNavigationController — pull request #10 by apurvam (2012-08-15 03:53:42+00:00)
Title: Add a  'viewControllers' property to FRLayeredNavigationController

A UINavigationController has a 'viewControllers' property which returns an array of all view controllers in the UINavigationController's hierarchy. This is useful when one is programmatically modifying the view hierarchy.

This pull request adds a readonly viewControllers property to FRLayeredNavigationController. Since FRLayeredNavigationController already had an internal viewControllers property which was a NSMutableArray, I have renamed the internal variable to 'myViewControllers'. This ensures that FRNavigationController can continue to remain as close as possible to the UINavigationController API.

So, now one can do things like :

```objective-c

FRLayeredNavigationController *fvc = ...

UIViewController *rootVC = [fvc.viewControllers objectAtIndex:0];

[fvc popToRootViewControllerAnimated:NO];

UIViewController *newVC = ...

[fvc pushViewController:newVC inFrontOf:rootVC maximumWidth:NO animated:NO]

```

Without access to the root view controller, this kind of programmatic manipulation would be impossible. Thus exposing a 'viewControllers' property can be very useful.