Classes

The following classes are available globally.

  • A Material flat, raised or floating button.

    All buttons display animated ink splashes when the user interacts with the button.

    The title color of the button set to have an accessible contrast ratio with the button’s background color. To ensure this works for flat buttons (with transparent background), the caller is responsible for setting (and updating, if necessary) the button’s underlyingColor property.

    All buttons set the exclusiveTouch property to YES by default, which prevents users from simultaneously interacting with a button and other UI elements.

    See more

    Declaration

    Objective-C

    @interface MDCButton : UIButton
  • A flat MDCButton.

    Flat buttons should be considered the default button. They do not have their own background color, do not raise when touched, and have uppercased text to indicate to the user that they are buttons. Flat buttons should be used in most situations requiring a button. For layouts with many UI elements in which a flat button might get visually lost, consider using a MDCRaisedButton instead.

    Warning

    This class will be deprecated soon. Consider using @c MDCTextButtonThemer with an @c MDCButton instead.

    See more

    Declaration

    Objective-C

    @interface MDCFlatButton : MDCButton
  • A raised MDCButton.

    Raised buttons have their own background color, float above their parent slightly, and raise briefly when touched. Raised buttons should be used when flat buttons would get lost among other UI elements on the screen.

    Warning

    This class will be deprecated soon. Consider using @c MDCContainedButtonThemer with an @c MDCButton instead.

    Declaration

    Objective-C

    @interface MDCRaisedButton : MDCButton
  • Custom gesture recognizer to observe the various ink response states.

    MDCInkGestureRecognizer is a continuous recognizer that tracks single touches and optionally fails if the touch moves outside the recongizer’s view. Multiple touches will cause the recognizer to transition to the UIGestureRecognizerStateCancelled state.

    See more

    Declaration

    Objective-C

    @interface MDCInkGestureRecognizer : UIGestureRecognizer
  • MDCInkTouchController associates a MDCInkView with a UIGestureRecognizer to control the spread of the ink.

    Subclasses should avoid overriding the UIGestureRecognizerDelegate gestureRecognizerShouldBegin: and gestureRecognizer:shouldReceiveTouch: methods to avoid breaking MDCInkTouchControllerDelegate.

    NOTE: The controller does not keep a strong reference to the view to which it is attaching an ink view. It is expected that the view will keep a strong reference to its own ink controller, or that the view controller controlling the view will keep a strong reference to that view’s ink controller.

    See more

    Declaration

    Objective-C

    @interface MDCInkTouchController : NSObject <UIGestureRecognizerDelegate>
  • A UIView that draws and animates the Material Design ink effect for touch interactions.

    There are two kinds of ink:

    Bounded ink: Ink that spreads from a point and is contained in the bounds of a UI element such as a button. The ink is visually clipped to the bounds of the UI element. Bounded ink is the most commonly-used ink in the system. Examples include basic Material buttons, list menu items, and tile grids.

    Unbounded ink: Ink that spreads out from a point on top of other UI elements. It typically reaches a maximum circle radius and then fades, unclipped by other UI elements. Typically used when interacting with small UI elements such as navigation bar icons or slider thumb controls. Examples include overflow menus, icon toggle buttons, and phone dialer keys.

    Note that the two kinds of ink are designed to have different animation parameters, that is, bounded ink isn’t just clipped unbounded ink. Whether the ink is bounded or not depends on the kind of UI element the user is interacting with.

    See more

    Declaration

    Objective-C

    @interface MDCInkView : UIView
  • Metrics of the Material shadow effect.

    These can be used if you require your own shadow implementation but want to match the material spec.

    See more

    Declaration

    Objective-C

    @interface MDCShadowMetrics : NSObject
  • The Material shadow effect.

    @see https://material.io/guidelines/what-is-material/elevation-shadows.html#elevation-shadows-shadows

    Consider rasterizing your MDCShadowLayer if your view will not generally be animating or changing size. If you need to animate a rasterized MDCShadowLayer, disable rasterization first.

    For example, if self’s layerClass is MDCShadowLayer, you might introduce the following code:

    self.layer.shouldRasterize = YES;
    self.layer.rasterizationScale = [UIScreen mainScreen].scale;
    
    See more

    Declaration

    Objective-C

    @interface MDCShadowLayer : CALayer
  • MDCCornerTreatment is a factory for creating MDCPathGenerators that represent the path of a corner.

    MDCCornerTreatments should only generate corners in the top-left quadrant (i.e. the top-left corner of a rectangle). MDCShapeModel will translate the generated MDCPathGenerator to the expected position and rotation.

    See more

    Declaration

    Objective-C

    @interface MDCCornerTreatment : NSObject <NSCopying>
  • MDCEdgeTreatment is a factory for creating MDCPathGenerators that represent the path of a edge.

    MDCEdgeTreaments only generate in the top quadrant (i.e. the top edge of a rectangle). MDCShapeModel will transform the generated MDCPathGenerator to the expected position and rotation.

    See more

    Declaration

    Objective-C

    @interface MDCEdgeTreatment : NSObject <NSCopying>
  • MDCPathGenerator is a factory for creating CGPaths. Describe your path with the lineTo and addArc… methods, then call appendToCGPath to append them to a CGPath.

    Note

    MDCPathGenerators always start at (0, 0) and end at @c endPoint.
    See more

    Declaration

    Objective-C

    @interface MDCPathGenerator : NSObject
  • An MDCShapeGenerating for creating shaped rectanglular CGPaths.

    By default MDCRectangleShapeGenerator creates rectanglular CGPaths. Set the corner and edge treatments to shape parts of the generated path.

    See more

    Declaration

    Objective-C

    @interface MDCRectangleShapeGenerator : NSObject <MDCShapeGenerating>
  • MDCShapedView is a primitive view class which makes it easy to style the shape of the view’s edges and corners.

    MDCShapedView manages mapping the paths generated by the shapeGenerator to the backing CAShapeLayer whenever the view is resized.

    See more

    Declaration

    Objective-C

    @interface MDCShapedView : UIView