LoginSignup
1
0

More than 5 years have passed since last update.

Swift 端末のバージョン取得

Last updated at Posted at 2018-01-05

Swift で端末のバージョンを取得する。

端末のバージョンを取得しそのバージョンが指定バージョンよりも高いか低いかを判定する方法になります。

実行中のアプリのバージョンが8.0.0以上か以下かの判定を行えます。

下記サイト引用

switch UIDevice.current.systemVersion.compare("8.0.0", options: .numeric) {
        case .orderedSame, .orderedDescending:
            print("iOS >= 8.0")
            return true
        case .orderedAscending:
            print("iOS < 8.0")
            return false
        }
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0