SBSDKBoxesLayer

@interface SBSDKBoxesLayer : CAShapeLayer

A CAShapeLayer subclass to draw rectangles to mark detected objects.

  • The boxes to display.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSArray<id<SBSDKBoxedObject>> *_Nonnull boxes;

    Swift

    var boxes: [SBSDKBoxedObject] { get set }
  • The color to draw the boxes outlines.

    Declaration

    Objective-C

    @property (nonatomic, strong, nonnull) UIColor *lineColor;

    Swift

    var lineColor: UIColor { get set }
  • The color to fill the boxes with. Defaults to clear color.

    Declaration

    Objective-C

    @property (nonatomic, strong, nonnull) UIColor *boxFillColor;

    Swift

    var boxFillColor: UIColor { get set }
  • The corner radius for the drawn boxes. Defaults to 4.0f;

    Declaration

    Objective-C

    @property (nonatomic) CGFloat boxCornerRadius;

    Swift

    var boxCornerRadius: CGFloat { get set }
  • A transform for the boxes drawing. Defaults to identity.

    Declaration

    Objective-C

    @property (nonatomic) CGAffineTransform drawingTransform;

    Swift

    var drawingTransform: CGAffineTransform { get set }
  • Designated initializer.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithBoxes:
                                (nonnull NSArray<id<SBSDKBoxedObject>> *)boxes
                                lineColor:(nonnull UIColor *)lineColor
                             boxFillColor:(nonnull UIColor *)fillColor;

    Swift

    init(boxes: [SBSDKBoxedObject], lineColor: UIColor, boxFill fillColor: UIColor)

    Parameters

    boxes

    The boxes as NSValue encoded NSRects.

    lineColor

    The initial color for the boxes outline color.

    fillColor

    The initial color for the boxes fill color.