OperatingSystem.IsMacOSVersionAtLeast(Int32, Int32, Int32) 方法

定義

檢查 libobjc.get_operatingSystemVersion) 所傳回的 macOS 版本 (是否大於或等於指定的版本。 這個方法可以用來保護在指定的 macOS 版本中新增的 API。

public static bool IsMacOSVersionAtLeast (int major, int minor = 0, int build = 0);
static member IsMacOSVersionAtLeast : int * int * int -> bool
Public Shared Function IsMacOSVersionAtLeast (major As Integer, Optional minor As Integer = 0, Optional build As Integer = 0) As Boolean

參數

major
Int32

主要版本號碼。

minor
Int32

次要版本號碼。

build
Int32

組建版本號碼。

傳回

Boolean

如果目前的應用程式是在 macOS 上執行,且版本至少為參數中指定的值,則為 true;否則為 false

適用於