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 APIfor the Material App Bar. This contrasts with the
injectionAPIs 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.
- Wrapped view controllers often need to be unwrapped in a variety of settings.
- The wrapped view controller’s parentViewController is now a level of indirection from its previous parent.
- Wrapping a view controller can affect things like
isMovingToParentViewControllerin wonderfully subtle ways.
@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.
NoteIf 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.
@interface MDCAppBarNavigationController : UINavigationController
The MDCAppBar class creates and configures the constellation of components required to represent a Material App Bar.
A Material App Bar consists of a Flexible Header View with a shadow, a Navigation Bar, and space for flexible content such as a photo.
The Material Guidelines article for Scrolling Techniques has more detailed recommendations and guidance.
AppBar depends on the FlexibleHeader, HeaderStackView, and NavigationBar Material Components.
WarningThis API will be deprecated in favor of MDCAppBarViewController. Learn more at https://github.com/material-components/material-components-ios/blob/develop/components/AppBar/docs/migration-guide-appbar-appbarviewcontroller.md
@interface MDCAppBar : NSObject
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
@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.
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
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.
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
@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.
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 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
@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.
Material NavigationBarTextColorAccessibilityMutator depends on the Navigation Bar material component and MDFTextAccessibility Framework.See more
@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