SBSDKPolygonEdge

@interface SBSDKPolygonEdge : NSObject <NSCopying>

Helper class that encapsulates an edge of a polygon and provides geometric helper methods.

  • p1

    The start point of the edge.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGPoint p1;

    Swift

    var p1: CGPoint { get set }
  • p2

    The end point of the edge.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGPoint p2;

    Swift

    var p2: CGPoint { get set }
  • The center of the edge.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGPoint center;

    Swift

    var center: CGPoint { get set }
  • Designated initializer.

    Declaration

    Objective-C

    - (instancetype)initWithPoint:(CGPoint)p1 andPoint:(CGPoint)p2;

    Swift

    init!(point p1: CGPoint, andPoint p2: CGPoint)

    Parameters

    p1

    The start point of the edge.

    p2

    The end point of the edge.

  • The length of the receiver. In other words the distance between p1 and p2.

    Declaration

    Objective-C

    - (CGFloat)length;

    Swift

    func length() -> CGFloat
  • The axis-aligned bounding box of the receiver.

    Declaration

    Objective-C

    - (CGRect)boundingBox;

    Swift

    func boundingBox() -> CGRect
  • The orientation of the receiver. See SBSDKPolygonEdgeOrientation

    Declaration

    Objective-C

    - (SBSDKPolygonEdgeOrientation)orientation;

    Swift

    func orientation() -> SBSDKPolygonEdgeOrientation