We need to get the information of the device for two reasons.
Firstly, it identifies user (one device can have many accounts)
Secondly, we can know what kind of device use our App at most that in the future development, we can optimize and do better in device compability.
name | String | The name of the device. |
systemName | String | The name of the operating system running on the device. |
systemVersion | String | The current version of the operating system. |
model | String | The model of the device. |
localizedModel | String | The model of the device as a localized string. |
userInterfaceIdiom | UIUserInterfaceIdiom | The style of interface to use on the current device. |
identifierForVendor | UUID | An alphanumeric string that uniquely identifies a device to the app’s vendor. |
init(){
let name = UIDevice.current.name
let systemName = UIDevice.current.systemName
let systemVersion = UIDevice.current.systemVersion
let model = UIDevice.current.model
let localizedModel = UIDevice.current.localizedModel
let userInterfaceIdiom = UIDevice.current.userInterfaceIdiom
let identifierForVendor = UIDevice.current.identifierForVendor
print(name)
print(systemName)
print(systemVersion)
print(model)
print(localizedModel)
print(userInterfaceIdiom)
print(identifierForVendor)
}