UIBezierPath-Superpowers icon indicating copy to clipboard operation
UIBezierPath-Superpowers copied to clipboard

[Feature] Cocoa support

Open stripes opened this issue 7 years ago • 5 comments

Thanks for writing this! I want almost this exact thing, except for NSBezierPath (I'm not writing a iOS app, I'm driving a laser cutter from my Mac).

I'm going to give writing the NSBezierPath version a shot.

stripes avatar Jan 30 '18 06:01 stripes

& I have one that works for NSBezierPath, except all the swizzling stuff is not yet hooked up to note each mutation (I happen to currently be using it AFTER I am done mutating the paths)

stripes avatar Feb 01 '18 06:02 stripes

Hi there. Sorry for the delayed response. Driving a laser cutter using this library sound so dope! Thanks for that :). It should be fairly ease to implement support for NSBezierPath, actually. Both UIBezierPath and NSBezierPath are merely wrappers for CGPath, so we should be able to introduce some #if to check if we're on macOS or iOS and keep the API as is. I'll have a look into that today. If you already have worked out something, feel free to submit a PR, I'll happily accept it. :)

CodingMeSwiftly avatar Feb 01 '18 09:02 CodingMeSwiftly

Update: NSBezierPath has quite a different interface than UIBezierPath and you apparently cannot access the underlying CGPath - bummer. Supporting both Cocoa and CocoaTouch requires some changes to the overall structure of the project. I'm willing to undertake this, however it might take some days for me to finish. I'll try to publish the new version by the end of the week. (Including both CocoaPods and Carthage support - Yay).

CodingMeSwiftly avatar Feb 01 '18 11:02 CodingMeSwiftly

I have one working, except the method swizzle for detecting changes is incomplete (I use NSBezierPaths in a mostly immutable way).

I just made a copy of the file & changed what was needed. I’m sure with a little effort most of the code could be shared between UI and NS versions.

--

On Feb 1, 2018, at 03:24, Max Kraus [email protected] wrote:

Update: NSBezierPath has quite a different interface than UIBezierPath and you apparently cannot access the underlying CGPath - bummer. Supporting both Cocoa and CocoaTouch requires some changes to the overall structure of the project. I'm willing to undertake this, however it might take some days for me to finish. I'll try to publish the new version by the end of the week. (Including both CocoaPods and Carthage support - Yay).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

stripes avatar Feb 01 '18 14:02 stripes

I've never actually made a pull request before, so hopefully I did it right. I sent you the NSBezierPath version I have. Let me know if it didn't make it.

stripes avatar Feb 01 '18 15:02 stripes