MDCAppBarNavigationController


@interface MDCAppBarNavigationController : UINavigationController

A custom navigation controller instance that auto-injects App Bar instances into pushed view controllers.

If a pushed view controller already has an App Bar or a Flexible Header then the navigation controller will not inject a new App Bar.

To theme the injected App Bar, implement the delegate’s -appBarNavigationController:willAddAppBar:asChildOfViewController: API.

Note

If you use the initWithRootViewController: API you will not have been able to provide a delegate yet. In this case, use the -appBarForViewController: API to retrieve the injected App Bar for your root view controller and execute your delegate logic on the returned result, if any.
  • Returns the injected App Bar view controller for a given view controller, if an App Bar was injected.

    Declaration

    Objective-C

    - (nullable MDCAppBarViewController *)appBarViewControllerForViewController:
        (nonnull UIViewController *)viewController;
  • A block that is assigned to each injected @c MDCAppBarViewController’s @c traitCollectionDidChangeBlock property. The block will be executed when the injected @c MDCAppBarViewController’s @c -traitCollectionDidChange: is called.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) void (^)
        (MDCFlexibleHeaderViewController *_Nonnull, UITraitCollection *_Nullable)
            traitCollectionDidChangeBlockForAppBarController;