ap4y / UIBezierPath-SVG

NS/UIBezierPath from SVG string
179 stars 26 forks source link

OSX compatibility and updated for ARC #5

Closed mredig closed 9 years ago

mredig commented 9 years ago

I updated the code to be compatible with ARC and also added the ability to use the same class categories on OSX. Sample OSX code also provided.

ap4y commented 9 years ago

Hey @mredig thanks for the awesome PR, I just wanted to ask you to update a code a bit to match code style in repo? Also it would be awesome to squash commits a bit into 1-2 commits with detailed message. Let me know if it's ok.

ap4y commented 9 years ago

I also not sure about SKU prefix. I think current naming is more idiomatic for obj-c categories. What do you think?

mredig commented 9 years ago

I'm not sure how I would go about reducing the number of commits. My work style is to get to a checkpoint, commit, go crazy with experimentation, get something that works, commit, etc. Still pretty new at this whole programming and git thing!

As for SKU, that's just what I'm using in my SpriteKit Utilities library. I basically just modified it to fit into that, and pulled the code out to contribute back to this project. The only reason I went with that is because OSX uses NSBezierPath, while iOS uses UIBezierPath. They are very similar, but not quite the same (you'll see I also had to add a category for NSBezierPath to be able to handle quadratic points, as well as the ability to handle a CGPath property). While I was experimenting, I simply defined NSBezierPath to UIBezierPath as well as the similar methods (NS - lineToPoint/UI - addLineToPoint, etc), but had a gut feeling that that could potentially cause problems down the road. So after I got to a place where it was working well, swapped it out for SKU as a prefix. It wouldn't be too hard to swap it back to what it was before, but I don't know if that's a good idea or not.

ap4y commented 9 years ago

Ok, I agree renaming makes sense. The only thing I still want to fix is a formatting consistency. I would like to preserve current code formatting style. Would you mind fixing it? Or I can fix it myself and we will discuss my changes, if it will be ok with you we will merge it. If you prefer me fixing formatting, then we have several options:

Let me know what you think.

mredig commented 9 years ago

I'll do what I can to get it as close as possible. If I miss anything, you are more than welcome to finish it. :)

mredig commented 9 years ago

Okay, I did what you asked to the best of my abilities. If you'd rather do it another way, you are more than welcome to follow one of your alternative strategies. I don't care too much about credit, but if you decide to throw my name and/or a link to my github in the comments, I won't complain at all. :)

I hope these modifications were helpful!

ap4y commented 9 years ago

Sorry about delay, was a bit busy last week. PR looks awesome, I cleaned a minor things in examples and added contributors information to the README. Thanks again for the PR.

mredig commented 9 years ago

No problem whatsoever! I'm glad I could help!