<commit_before>## UIBezierPathPort

### Overview
An extension on ```NSBezierPath``` (OS X) to mimic some of ```UIBezierPath``` (iOS) public interface.
Most notabily adding QuadCurves and ```CGPath``` property (getter and setter) amongst others



### Usage

You can run this on Mac OS
##### Sample
```swift
//// Quad Curves
var quadPath = UIBezierPath()
quadPath.moveToPoint(CGPointMake(208.44, -63.56))
quadPath.addQuadCurveToPoint(CGPointMake(171.21, 205.77), controlPoint: CGPointMake(205.78, -60.35))
quadPath.addQuadCurveToPoint(CGPointMake(123.35, -21.87), controlPoint: CGPointMake(11.68, 67.9))
quadPath.addQuadCurveToPoint(CGPointMake(-41.5, -21.87), controlPoint: CGPointMake(123.35, -21.87))
quadPath.addQuadCurveToPoint(CGPointMake(171.21, 19.81), controlPoint: CGPointMake(-41.5, 186.53))


//// Rounded Rectangle 
let rectanglePath = UIBezierPath(roundedRect: CGRectMake(210, 69, 142, 149), cornerRadius: 19)


//// Rectangle
let rectangle2Path = UIBezierPath(rect: CGRectMake(35, 69, 143, 149))


//// Two RoundedCorners Rectangle
var rectangle3Path = UIBezierPath(roundedRect: CGRectMake(408, 69, 142, 149), byRoundingCorners: UIRectCorner.fromMask(UIRectCorner.TopRight.toRaw() | UIRectCorner.BottomLeft.toRaw()), cornerRadii: CGSizeMake(50, 50))
rectangle3Path.closePath()


//// Oval Drawing
var ovalPath = UIBezierPath(ovalInRect: CGRectMake(35, 298, 130, 109))


//// Half Oval 2 Drawing
var oval2Rect = CGRectMake(222, 298, 130, 109)
var oval2Path = UIBezierPath()
oval2Path.addArcWithCenter(CGPointMake(0.0, 0.0), radius: oval2Rect.width / 2, startAngle: -11 * M_PI/180, endAngle: 160 * M_PI/180, clockwise: true)

``` 

##### API
```swift
  var CGPath:CGPathRef! {get set}
  init()
  init(roundedRect rect: NSRect, cornerRadius: CGFloat)
  init(roundedRect rect: NSRect, byRoundingCorners corners: UIRectCorner, cornerRadii: NSSize)
  init(arcCenter center: CGPoint, radius: CGFloat, startAngle: CGFloat, endAngle: CGFloat, clockwise: Bool)
  init(CGPath: CGPathRef!)
  func addLineToPoint(point: NSPoint)
  func addCurveToPoint(endPoint: NSPoint, controlPoint1: NSPoint, controlPoint2: NSPoint)
  func addQuadCurveToPoint(endPoint: NSPoint, controlPoint: NSPoint)
  func addArcWithCenter(center: NSPoint, radius: CGFloat, startAngle: CGFloat, endAngle: CGFloat, clockwise: Bool)
  func appendPath(path: NSBezierPath!)
```




###Contact


If you end up using UIBezierPathPort in a project, I'd love to hear about it.

email: [<EMAIL>](mailto:<EMAIL>)  
twitter: [@seivanheidari](https://twitter.com/seivanheidari)
<commit_msg>Move API to the top<commit_after>## UIBezierPathPort

### Overview
An extension on ```NSBezierPath``` (OS X) to mimic some of ```UIBezierPath``` (iOS) public interface.
Most notabily adding QuadCurves and ```CGPath``` property (getter and setter) amongst others



### Usage

##### API
```swift
  var CGPath:CGPathRef! {get set}
  init()
  init(roundedRect rect: NSRect, cornerRadius: CGFloat)
  init(roundedRect rect: NSRect, byRoundingCorners corners: UIRectCorner, cornerRadii: NSSize)
  init(arcCenter center: CGPoint, radius: CGFloat, startAngle: CGFloat, endAngle: CGFloat, clockwise: Bool)
  init(CGPath: CGPathRef!)
  func addLineToPoint(point: NSPoint)
  func addCurveToPoint(endPoint: NSPoint, controlPoint1: NSPoint, controlPoint2: NSPoint)
  func addQuadCurveToPoint(endPoint: NSPoint, controlPoint: NSPoint)
  func addArcWithCenter(center: NSPoint, radius: CGFloat, startAngle: CGFloat, endAngle: CGFloat, clockwise: Bool)
  func appendPath(path: NSBezierPath!)
```

##### Sample
```swift
//// Quad Curves
var quadPath = UIBezierPath()
quadPath.moveToPoint(CGPointMake(208.44, -63.56))
quadPath.addQuadCurveToPoint(CGPointMake(171.21, 205.77), controlPoint: CGPointMake(205.78, -60.35))
quadPath.addQuadCurveToPoint(CGPointMake(123.35, -21.87), controlPoint: CGPointMake(11.68, 67.9))
quadPath.addQuadCurveToPoint(CGPointMake(-41.5, -21.87), controlPoint: CGPointMake(123.35, -21.87))
quadPath.addQuadCurveToPoint(CGPointMake(171.21, 19.81), controlPoint: CGPointMake(-41.5, 186.53))


//// Rounded Rectangle 
let rectanglePath = UIBezierPath(roundedRect: CGRectMake(210, 69, 142, 149), cornerRadius: 19)


//// Rectangle
let rectangle2Path = UIBezierPath(rect: CGRectMake(35, 69, 143, 149))


//// Two RoundedCorners Rectangle
var rectangle3Path = UIBezierPath(roundedRect: CGRectMake(408, 69, 142, 149), byRoundingCorners: UIRectCorner.fromMask(UIRectCorner.TopRight.toRaw() | UIRectCorner.BottomLeft.toRaw()), cornerRadii: CGSizeMake(50, 50))
rectangle3Path.closePath()


//// Oval Drawing
var ovalPath = UIBezierPath(ovalInRect: CGRectMake(35, 298, 130, 109))


//// Half Oval 2 Drawing
var oval2Rect = CGRectMake(222, 298, 130, 109)
var oval2Path = UIBezierPath()
oval2Path.addArcWithCenter(CGPointMake(0.0, 0.0), radius: oval2Rect.width / 2, startAngle: -11 * M_PI/180, endAngle: 160 * M_PI/180, clockwise: true)

``` 





###Contact


If you end up using UIBezierPathPort in a project, I'd love to hear about it.

email: [<EMAIL>](mailto:<EMAIL>)  
twitter: [@seivanheidari](https://twitter.com/seivanheidari)

{'fraction_non_alphanumeric': 0.1345926800472255, 'fraction_numerical': 0.06454151908697363, 'mean_word_length': 5.953488372093023, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5226305', 'n_tokens_mistral': 2144, 'n_tokens_neox': 1797, 'n_words': 435}