I'm looking to make an inverted clipping CGPath based on an input CGPath shape on macOS. My plan is to simply make a sufficiently big simple rect and then add a reversed order version of the input path into it to make the hole, based on the winding direction rule.
The problem is that I can't seem to find any way to reverse the CGPath. On iOS there seems to be a bezierPathByReversingPath for UIBezierPath, but I can't find anything like it on macOS (EDIT: turns out this was a mistake on my part, NSBezierPath has a corresponding method). Does anyone know how to reverse the point order / drawing direction of an existing CGPath?
I found this old thread, from eight years ago asking for more or less the same thing, but there seem to be no solutions there for macOS except for one, where the links are unfortunately no longer working and I'm not allowed to comment. How to reverse the point order of a CGPath So I'm hoping for better luck this time.