The existing code only allows rotation on the FGalleryViewController - all other view controllers in the navigation stack will only rotate into portrait (though they can appear in landscape if a FGalleryViewController is popped from the stack while in landscape). This fix will walk the navigation stack to see if the stacked view controllers all support the specified orientation. If so, then the navigation controller will allow it; otherwise, it defaults to the current code and only allows portrait.
The existing code only allows rotation on the FGalleryViewController - all other view controllers in the navigation stack will only rotate into portrait (though they can appear in landscape if a FGalleryViewController is popped from the stack while in landscape). This fix will walk the navigation stack to see if the stacked view controllers all support the specified orientation. If so, then the navigation controller will allow it; otherwise, it defaults to the current code and only allows portrait.