Swift macOSのバージョン情報取得

Pocket

SwiftでmacOSのバージョン情報を取得するコードは下記です

let osVersion = ProcessInfo.processInfo.operatingSystemVersion
print(osVersion)

NSOperatingSystemVersionというのが返るようで

majorVersion, minorVersion, patchVersionがInt型で入っています

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA


2022 MJELD TECHNOLOGIES. ALL RIGHTS RESERVED