-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve OSX compatibility #4
Conversation
Hey there, Thanks for the pull request! It's looking good, but building for OS X fails as there's a problem on line 12 of PocketSVG.h: 'UIKit/UIkit.h' file not found I don't understand why, as the ifdefs are working fine on the .m file. I tried adding #include "TargetConditionals.h" to the top of the file but still get the same problem... Any ideas? Ariel |
Hi Ariel. This works for me:
|
Good catch mindbrix, when building for osx, TARGET_OS_IPHONE is defined, but as 0. My last commit fixes it throughout the project. I also saw that error, but assuming it was a discrepancy between our environments I just #undef'd TARGET_OS_IPHONE in my .pch Mike |
Hey Mike (and Nigel), Thanks for your contribution. I've now merged your pull request. I would now like to add an example Xcode project for OS X, I'm working on it on the project's develop branch. As you might see, things are working fine except for the CAShapeLayer's rendering upside down (uncomment line 290 of PocketSVG.m on the develop branch). I'm trying to find a way of doing this without calling CGContextTranslateCTM... Let me know if you have any ideas.. Ariel |
Hi Ariel. This translates from UIKit to Quartz coordinate spaces, vertically inverting the coordinates. It might work for SVGKit on OS X too. Nigel. CGAffineTransform uiKitCTM( CGRect viewBounds ) |
Ariel, If you move the drawing code to a subclass of NSView, you can override
to flip the vertical plane. (I'm sure this just uses Nigel's solution.) Mike |
Hey guys, I now created separate directories for the iOS and OS X sample projects, they both use PocketSVG.h and PocketSVG.m which stays in the root directory. Ariel |
I fixed a couple syntax errors encountered when building for OSX.