Skip to content

Instantly share code, notes, and snippets.

@alfredmyers
Created November 23, 2017 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfredmyers/311cfcba4d9370a3ae1abd619d52376d to your computer and use it in GitHub Desktop.
Save alfredmyers/311cfcba4d9370a3ae1abd619d52376d to your computer and use it in GitHub Desktop.
Xamarin.Forms.Device.OS and Xamarin.Forms.TargetPlatform deprecated
if (Device.RuntimePlatform == Device.Android)
{
//platform specific code
}
else if (Device.RuntimePlatform == Device.iOS)
{
//platform specific code
}
if (Device.OS == TargetPlatform.Android)
{
//platform specific code
}
else if (Device.OS == TargetPlatform.iOS)
{
//platform specific code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment