Showing posts with label Hackalicious. Show all posts
Showing posts with label Hackalicious. Show all posts

Friday, February 7, 2014

Customizing UINavigationItem

When an app you are writing is intended to have a highly customized look one of the things that may get special treatment is the UINavigationItem for view controllers that are managed by a UINavigationBar object.

Each UIViewController has its own UINavigationItem property that is pushed or popped by a UINavigationBar object that lays out navigation bar at the top of the view. 

I had two goals. 1) Drop custom left and right bar button items and custom text on the navigation bar and 2) Customize the animations between the navigation items in the navigation bar. So I needed to sub-class UINavigationBar for 2). And I needed to create a custom UINavigationItem that I could reuse everywhere and give the app a consistent look and feel. This would satisfy 1).