Classes

The following classes are available globally.

  • The MDCAppBarContainerViewController controller provides an interface for placing a UIViewController behind an App Bar.

    The MDCAppBarContainerViewController class is commonly referred to as the wrapper API for the Material App Bar. This contrasts with the injection APIs as represented by the APIs in MDCAppBar.h.

    Use the MDCAppBarContainerViewController class when you do not own and cannot alter a view controller to which you want to add an App Bar. If you do own and can modify a view controller it is recommended that you use the MDCAppBar.h APIs instead.

    Why we recommend using the MDCAppBar.h APIs over this one

    Wrapping a view controller affects your app code in a variety of not-so-nice ways.

    1. Wrapped view controllers often need to be unwrapped in a variety of settings.
    2. The wrapped view controller’s parentViewController is now a level of indirection from its previous parent.
    3. Wrapping a view controller can affect things like isMovingToParentViewController in wonderfully subtle ways.
    See more

    Declaration

    Objective-C

    @interface MDCAppBarContainerViewController : UIViewController
  • 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.
    See more

    Declaration

    Objective-C

    
    @interface MDCAppBarNavigationController : UINavigationController
  • The MDCFlexibleHeaderContainerViewController controller is a straightforward container of a content view controller and a MDCFlexibleHeaderViewController.

    This view controller may be used in situations where the content view controller can’t have a header injected into its view hierarchy. UIPageViewController is one such view controller.

    See more

    Declaration

    Objective-C

    @interface MDCFlexibleHeaderContainerViewController : UIViewController
  • MDCFlexibleHeaderView tracks the content offset of a scroll view and adjusts its size and position according to a configurable set of behaviors.

    UIScrollViewDelegate forwarding

    This view relies on you informing it of certain UIScrollViewDelegate events as they happen. These events are listed in the UIScrollViewDelegate events section.

    See more

    Declaration

    Objective-C

    @interface MDCFlexibleHeaderView : UIView
  • The MDCFlexibleHeaderViewController controller is a simple UIViewController-oriented interface for the flexible header view.

    Note that for this view controller, self.view == self.headerView. This is because this view controller is not meant to take up the full screen. Rather, it should be added as a child view controller within another view controller.

    UIScrollViewDelegate

    Instances of this view controller implement the UIScrollViewDelegate methods that must be forwarded to the flexible header view, so if you do not need to process the scroll view events yourself you can set the header view controller instance as your scroll view delegate.

    scrollView.delegate = headerViewController;

    See more

    Declaration

    Objective-C

    @interface MDCFlexibleHeaderViewController
        : UIViewController <UIScrollViewDelegate, UITableViewDelegate>
  • The MDCHeaderStackView class lays out a vertical stack of two views.

    Both bars provided to this view must implement sizeThatFits and return their best-fit dimensions.

    Layout Behavior

    The layout behavior of the two bars is as follows:

    topBar: top aligned, expands to fill all available vertical space not taken up by the bottomBar. bottomBar: bottom aligned.

    If no bottomBar is provided, top bar consumes the entire bounds of the stack view.

    When resized, the top bar will shrink until it reaches its sizeThatFits dimensions. If there is a bottom bar, then at this point the top bar will begin sliding off the top. If there is no bottom bar, then at this point the top bar will stay put.

    At no point in time will either the top or bottom bar shrink below their sizeThatFits height.

    sizeThatFits Behavior

    sizeThatFits returns the fitted height for bottom bar if available, otherwise it returns the fitted height for topBar. The width will be whatever width was provided.

    See more

    Declaration

    Objective-C

    @interface MDCHeaderStackView : UIView
  • The MDCNavigationBarTextColorAccessibilityMutator class creates an external object with which to work on an instance of a Material Navigation Bar to activate and ensure accessibility on its title and buttons.

    Dependencies

    Material NavigationBarTextColorAccessibilityMutator depends on the Navigation Bar material component and MDFTextAccessibility Framework.

    See more

    Declaration

    Objective-C

    @interface MDCNavigationBarTextColorAccessibilityMutator : NSObject
  • The MDCNavigationBar class is a view consisting of a leading and trailing button bar, title label, and an optional title view.

    This view is not designed to have subviews added to it except via through its declared properties (e.g. titleView).

    See more

    Declaration

    Objective-C

    @interface MDCNavigationBar : UIView