For example, #ifdef iOS, #ifdef android, or the like. If there is #if, that would be even better.
#if __MOBILE__
Console.WriteLine ("__MOBILE__ is defined");
#endif
#if __IOS__
Console.WriteLine ("__IOS__ is defined");
#endif
#if __MOBILE__
Console.WriteLine ("__MOBILE__ is defined");
#endif
#if __ANDROID__
Console.WriteLine ("__ANDROID__ is defined");
#endif
https://bugzilla.xamarin.com/show_bug.cgi?id=6459#c12
xamarin documentation
Yes it does, I don't know, if Xamarin.iOS provides its own symbols, as I'm new to Xamarin and I actually do not use Xamarin.iOS, but you can define your own symbols.
Right click on the project an open the project options. In the "Compiler" settings you can lookup existing flags and create add new ones. For example here are the symbols that are shipped with Xamarin.Android:
DEBUG;__MOBILE__;__ANDROID__;
The flags should be available immediately after you have defined them.
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