MDCCornerTreatment

@interface MDCCornerTreatment : NSObject <NSCopying>

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.

  • The value type of our corner treatment.

    When MDCCornerTreatmentValueType is MDCCornerTreatmentValueTypeAbsolute, then the accepted corner values are an absolute size. When MDCShapeSizeType is MDCCornerTreatmentValueTypePercentage, values are expected to be in the range of 0 to 1 (0% - 100%). These values are percentages based on the height of the surface.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) MDCCornerTreatmentValueType valueType;
  • Undocumented

    Declaration

    Objective-C

    - (nonnull instancetype)init NS_DESIGNATED_INITIALIZER;
  • Creates an MDCPathGenerator object for a corner with the provided angle.

    Declaration

    Objective-C

    - (nonnull MDCPathGenerator *)pathGeneratorForCornerWithAngle:(CGFloat)angle;

    Parameters

    angle

    The internal angle of the corner in radians. Typically M_PI/2.

  • Creates an MDCPathGenerator object for a corner with the provided angle. Given that the provided valueType is MDCCornerTreatmentValueTypePercentage, we also need the size of the view to calculate the corner size percentage relative to the view height.

    Declaration

    Objective-C

    - (nonnull MDCPathGenerator *)pathGeneratorForCornerWithAngle:(CGFloat)angle
                                                      forViewSize:(CGSize)size;

    Parameters

    angle

    the internal angle of the corner in radius. Typically M_PI/2.

    size

    the size of the view.

    Return Value

    returns an MDCPathGenerator.