August 2016
Beginner to intermediate
1049 pages
23h 17m
English
When using shared projects, file linking, or cloned project files, one of your most powerful tools is the use of preprocessor statements. If you are unfamiliar with them, C# has the ability to define preprocessor variables such as #define IPHONE , allowing you to use #if IPHONE or #if !IPHONE.
The following is a simple example of using this technique:
#if IPHONE
Console.WriteLine("I am running on iOS");
#elif ANDROID
Console.WriteLine("I am running on Android");
#else
Console.WriteLine("I am running on ???");
#endifIn Xamarin Studio, you can define preprocessor variables in your project's options by navigating to Build | Compiler | Define Symbols, delimited with semicolons. These will be applied to the entire project. ...
Read now
Unlock full access