Click here to support Nimbus development and make a donation at !
An iOS framework whose growth is bounded by O(documentation).
NINavigationAppearance Class Reference


Class for saving and restoring the navigation appearance state.

You use this when you are about to mutate the navigation bar style and/or status bar style, and you want to be able to restore these bar styles sometime in the future.

An example of usage for this pattern is in NIToolbarPhotoViewController which changes the navigation bar style to UIBarStyleBlack and the status bar style to UIStatusBarStyleBlack* in viewWillAppear:.

 [NINavigationAppearance pushAppearanceForNavigationController:self.navigationController]

 UINavigationBar* navBar = self.navigationController.navigationBar;
 navBar.barStyle = UIBarStyleBlack;
 navBar.translucent = YES;

Note that the call to NINavigationAppearance must occur before mutating any bar states so that it is able to capture the original state correctly.

Then when NIToolbarPhotoViewController is ready to restore the original navigation appearance state, (in viewWillDisappear:), it calls the following:

 [NINavigationAppearance popAppearanceForNavigationController:self.navigationController]

which pops the last snapshot of the stack and applies it, restoring the original navigation appearance state.

Definition at line 57 of file NINavigationAppearance.h.


(void) + pushAppearanceForNavigationController:
(void) + popAppearanceForNavigationController:animated:
(NSInteger) + count
(void) + clear

Method Documentation

+ (void) pushAppearanceForNavigationController: (UINavigationController *)  navigationController

Take a snapshot of the current navigation appearance.

Call this method before mutating the nav bar style or status bar style.

Definition at line 71 of file NINavigationAppearance.m.

+ (void) popAppearanceForNavigationController: (UINavigationController *)  navigationController
animated: (BOOL)  animated 

Restore the last navigation appearance snapshot.

Pops the last appearance values off the stack and applies them.

Definition at line 83 of file NINavigationAppearance.m.

+ (NSInteger) count

Number of items in the appearance stack.

Definition at line 99 of file NINavigationAppearance.m.

+ (void) clear

Remove all navigation appearance snapshots from the stack.

Definition at line 105 of file NINavigationAppearance.m.

Generated for Nimbus by doxygen 1.7.4-20110629