How to subclass UINavigationController with a custom header or UINavigationBar?

Viewed 734

I would like to subclass UINavigationController to include a few types of headers that can transition from one to the other. I'm deliberating on a few things in the design:

  1. How should I manage the size of the child controller views? Constraining them to the bottom of each kind of header seems chunky and difficult to manage during transitions.
  2. I tried assigning a UIView subclass to the UINavigationController's view in loadView(), but doing so causes child controller views to not display (it appears black instead). Why does this unexpected behavior occur?
  3. How do I support the "drag from left to right" transition of UINavigationController?
  4. Is there a way to achieve this by subclassing UINavigationBar? If not, how can my custom view support UINavigationController's transition animations?
  5. Would there be any advantage to subclassing UIViewController instead and writing my own implementations of the basic UINavigationController behaviors?

Header 1

Header 2

1 Answers
Related