EXTENSION
Devicepublic extension Device
displaySizevar displaySize: Display.Size
Returns the display size in inches.
displayvar display: Display
Returns an extended info on the display, including all resolutions, scale and density.
familyvar family: Family
Associated family for each device.
marketingNamepublic var marketingName: String
The full marketing name of the model, e.g. “iPhone 7 Plus”, “Apple TV 4”.
productLinevar productLine: ProductLine?
Product line of the model.
init(identifier:)init?(identifier: String? = nil)
Creates a custom device out of a valid identifier.
If a device cannot be created, returns an unknown device.
| Name | Description |
|---|---|
| identifier | A device identifier, e.g. “iPhone9,2”, “iPad6,11.”, “AppleTV5,3”. |
isEqual(to:)func isEqual(to compared: Device) throws -> Bool
Checks if the current device is the same as the compared model.
| Name | Description |
|---|---|
| to | A model to compare the current device against. |
isNewerOrEqual(than:)func isNewerOrEqual(than compared: Device) throws -> Bool
Checks if the current device is newer (or same) than the compared model.
| Name | Description |
|---|---|
| than | A model to compare the current device against. |
isOlder(than:)func isOlder(than compared: Device) throws -> Bool
Checks if the current device is older than the compared model.
| Name | Description |
|---|---|
| than | A model to compare the current device against. |