ap4y / UIBezierPath-SVG

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

Added a define option to print commands to create a UIBezierPath to stdout #4

Open ralfebert opened 11 years ago

ap4y commented 11 years ago

Hi Ralf,

Thanks for the pull request. But I think Objective-C way to implement such type of logging is through forwardInvocation:. I made a gist as an example of possible implementation. With simple additions you can log any path operations.

Since proposed functionality implemented via forwardInvocation: will be generic to any UIBezierPath object, I think that this additions are beyond the scope of the project.

Cheers, Arthur

ralfebert commented 11 years ago

I went for the hard-coded-ifdef-approach because of the relative coordinates like "path.currentPoint.x + params[0]".

ap4y commented 11 years ago

Yes I understand that it could be tricky to handle all possible params, but in the end this class category simply invokes methods of the provided path instance according to the svg command. So it easier to hook to the instance method calls, since objective-c provides such functionality.