Edit

Share via


Platform Enum

Definition

Caution

Use [Introduced|Deprecated|Obsoleted|Unavailable] attributes with PlatformName.

Enumeration values for the various iOS and macOS platforms supported by Xamarin.

This enumeration supports a bitwise combination of its member values.

[System.Flags]
[System.Obsolete("Use [Introduced|Deprecated|Obsoleted|Unavailable] attributes with PlatformName.")]
public enum Platform
type Platform = 
Inheritance
Platform
Attributes

Fields

Name Value Description
None 0

No flags specified.

iOS_2_0 131072

Constant for iOS 2.0.

iOS_2_2 131584

Constant for iOS 2.2.

iOS_3_0 196608

Constant for iOS 3.0.

iOS_3_1 196864

Constant for iOS 3.1.

iOS_3_2 197120

Constant for iOS 3.2.

iOS_4_0 262144

Constant for iOS 4.0.

iOS_4_1 262400

Constant for iOS 4.1.

iOS_4_2 262656

Constant for iOS 4.2.

iOS_4_3 262912

Constant for iOS 4.3.

iOS_5_0 327680

Constant for iOS 5.0.

iOS_5_1 327936

Constant for iOS 5.1.

iOS_6_0 393216

Constant for iOS 6.0.

iOS_6_1 393472

Constant for iOS 6.1.

iOS_7_0 458752

Constant for iOS 7.0.

iOS_7_1 459008

Constant for iOS 7.1.

iOS_8_0 524288

Constant for iOS 8.0.

iOS_8_1 524544

Constant for iOS 8.1.

iOS_8_2 524800

Constant for iOS 8.2.

iOS_8_3 525056

Constant for iOS 8.3.

iOS_8_4 525312

Constant for iOS 8.4.

iOS_9_0 589824

Constant for iOS 9.0.

iOS_9_1 590080

Constant for iOS 9.1.

iOS_9_2 590336

Constant for iOS 9.2.

iOS_9_3 590592

Constant for iOS 9.3.

iOS_Version 16777215

Bitmask for the iOS version.

iOS_Arch32 16777216

This flag indicates iOS on 32 bits.

iOS_Arch64 33554432

This flag indicates iOS on 64 bits.

iOS_Arch 4278190080

This flag is used to indicate that this is iOS in general.

Mac_10_0 2814749767106560

Constant for MacOS 10.0.

Mac_10_1 2815849278734336

Constant for MacOS 10.1.

Mac_10_2 2816948790362112

Constant for MacOS 10.2.

Mac_10_3 2818048301989888

Constant for MacOS 10.3.

Mac_10_4 2819147813617664

Constant for MacOS 10.4.

Mac_10_5 2820247325245440

Constant for MacOS 10.5.

Mac_10_6 2821346836873216

Constant for MacOS 10.6.

Mac_10_7 2822446348500992

Constant for MacOS 10.7.

Mac_10_8 2823545860128768

Constant for MacOS 10.8.

Mac_10_9 2824645371756544

Constant for MacOS 10.9.

Mac_10_10 2825744883384320

Constant for MacOS 10.10.

Mac_10_10_3 2825757768286208

Constant for macOS 10.10.3.

Mac_10_11 2826844395012096

Constant for macOS 10.11.

Mac_10_11_3 2826857279913984

Constant for macOS 10.11.3.

Mac_10_12 2827943906639872

Constant for macOS 10.12.

Mac_Version 72057589742960640

Bitmask for the macOS version.

Mac_Arch32 72057594037927936

This flag indicates MacOS on 32 bits.

Mac_Arch64 144115188075855872

This flag indicates MacOS on 64 bits.

Mac_Arch 18374686479671623680

This flag is used to indicate that this is MacOS in general.

Remarks

This enumeration is also each platform and version that Xamarin's frameworks are aware of. It is the argument type for Introduced, Deprecated, Obsoleted, and Unavailable parameter in the AvailabilityAttribute constructor.

For example, the Platform.Mac_10_9 has the value 0x000a090000000000 and Platform.iOS_6_1 has the value 0x0000000000060100.

The underlying integer value of each Platform member is an actual version number. Platform values can be OR'd together, but only when the platform actually differs (e.g. a Mac version and an iOS version can be OR'd but two different Mac or iOS versions cannot).

Good: Platform.Mac_10_9 | Platform.iOS_7_0

Bad: Platform.Mac_10_8 | Platform.Mac_10_9

In addition to the Platform AvailabilityAttribute types, there's also PlatformHelper which contains a number of useful utilities for working with the Platform enumeration.

Applies to