SwiftでのDevice ID(UDID)の取得方法を勉強したので、まとめてみます。
Swiftバージョン: Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
【Swift5】Device ID(UDID)とは
Appleの各端末に与えられたApple固有の識別子。各端末ユニークなID
■Apple 公式ドキュメント
A universally unique value that can be used to identify types, interfaces, and other items.
UUID | Apple Developer Documentation
Declaration
1 |
struct UUID |
【Swift5】Device ID(UDID)の取得方法
1 2 3 |
let udid = UIDevice.current.identifierForVendor?.uuidString |
identifierForVendor
An alphanumeric string that uniquely identifies a device to the app’s vendor.
1 |
var identifierForVendor: UUID? { get } |
identifierForVendor | Apple Developer Documentation
参考記事: iOSでの端末固有識別子の話。
コメントを残す