@interface MDCShadowLayer : CALayer
The Material shadow effect.
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;
The elevation of the layer in points.
The higher the elevation, the more spread out the shadow is. This is distinct from the layer’s zPosition which can be used to order overlapping layers, but will have no affect on the size of the shadow.
Negative values act as if zero were specified.
The default value is 0.
@property (assign, readwrite, nonatomic) MDCShadowElevation elevation;
Whether to apply the
cutoutshadow layer mask.
If enabled, then a mask is created to ensure the interior, non-shadow part of the layer is visible.
Default is YES. Not animatable.
@property (getter=isShadowMaskEnabled, assign, readwrite, nonatomic) BOOL shadowMaskEnabled;
Animates the layer’s corner radius
At the end of the animation the corner radius is set to your desired corner radius.
- (void)animateCornerRadius:(CGFloat)cornerRadius withTimingFunction:(nonnull CAMediaTimingFunction *)timingFunction duration:(NSTimeInterval)duration;
The desired corner radius at the end of the animation
The timing function you desire for the animation
The duration of the animation