Skip to content
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

Support of NSView and OS X #27

Closed
oleksii-demedetskyi opened this issue Aug 24, 2013 · 8 comments · Fixed by #43, #44 or #45
Closed

Support of NSView and OS X #27

oleksii-demedetskyi opened this issue Aug 24, 2013 · 8 comments · Fixed by #43, #44 or #45
Assignees
Milestone

Comments

@oleksii-demedetskyi
Copy link
Owner

We need support NSView as well, but we need to have type checking in both cases.
I think typedef will be enough.

Also, we need to think about debugging support differences in os x.

@oleksii-demedetskyi
Copy link
Owner Author

DSL should be precise as for iOS, i believe that we need switch UIView to NSView.

@xNekOIx
Copy link
Collaborator

xNekOIx commented Jun 5, 2014

@AndreyMoskvin

#include "Availability.h"

#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED \
#define PVViewClass UIView \
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) \
#define PVViewClass NSView \
#else \
#error Can't identify platform to pick correct View class \
#endif

typedef PVViewClass PVView;

#undef PVViewClass

@Forsarion
Copy link
Collaborator

@xNekOIx looks correct :)

@oleksii-demedetskyi
Copy link
Owner Author

What about TARGET_PLATFORM macro?

@xNekOIx
Copy link
Collaborator

xNekOIx commented Jun 10, 2014

@Dalog @AndreyMoskvin BTW

<TargetConditionals.h>
    #define TARGET_OS_MAC               1
    #define TARGET_OS_WIN32             0
    #define TARGET_OS_UNIX              0
    #define TARGET_OS_EMBEDDED          1 
    #define TARGET_OS_IPHONE            1 
    #define TARGET_IPHONE_SIMULATOR     0 

@xNekOIx
Copy link
Collaborator

xNekOIx commented Jun 10, 2014

BTW have a look at Masonries solution for compatibility with Mac OS X https://github.com/Masonry/Masonry/blob/master/Masonry/MASUtilities.h

@Forsarion
Copy link
Collaborator

Haven't known about TARGET macros until this moment.

@oleksii-demedetskyi
Copy link
Owner Author

I think masonry approach is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment