EXTENSION
Device
public extension Device
displaySize
var displaySize: Display.Size
Returns the display size in inches.
display
var display: Display
Returns an extended info on the display, including all resolutions, scale and density.
family
var family: Family
Associated family for each device.
marketingName
public var marketingName: String
The full marketing name of the model, e.g. “iPhone 7 Plus”, “Apple TV 4”.
productLine
var 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. |