2

I need to work with a subclassed UIToolbar in the UINavigationController. I know this can be done via Interface Builder but I need it to be done programatically.

The docs state that the UINavigationController toolbar property is readonly so I'm at a bit of a loss as to how I proceed.

Related:

Community
  • 1
  • 1
sbonami
  • 1,892
  • 17
  • 33

1 Answers1

5

A new init* method has been available since iOS 5

- (instancetype)initWithNavigationBarClass:(Class)navigationBarClass 
                              toolbarClass:(Class)toolbarClass

Also don't forget

... you are responsible for adding a root view controller before presenting the navigation controller onscreen.

Paul.s
  • 38,494
  • 5
  • 70
  • 88