I'm currently working on a multiplatform app for iPhone and various other devices, as far as I can work out I can use preprocessor directives to check if I'm building for iPhone or another platform, so for example I could have:
#if WINDOWS_PHONE
ScreenRes = new Vector2(800,480);
#endif
#if XBOX360
ScreenRes = new Vector2(1280,720);
#endif
However I'm not sure which declaration I'm supposed to use to check for iPhone, I've already tried IPHONE, IOS, I_PHONE and a few others.
We do not define any by default. You can do this by adding the define yourself when you build it with MonoDevelop to your configurations.
Recent versions of Xamarin Studio will provide extra defines to the compiler.
E.g. for Xamarin.iOS both __MOBILE__
and __IOS__
will be defined.
E.g. for Xamarin.Android both __MOBILE__
and __ANDROID__
will be defined.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With