Closed oleksii-demedetskyi closed 10 years ago
DSL should be precise as for iOS, i believe that we need switch UIView to NSView.
@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
@xNekOIx looks correct :)
What about TARGET_PLATFORM macro?
@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
BTW have a look at Masonries solution for compatibility with Mac OS X https://github.com/Masonry/Masonry/blob/master/Masonry/MASUtilities.h
Haven't known about TARGET macros until this moment.
I think masonry approach is fine.
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.