Closed furiosFast closed 3 years ago
@furiosFast Did you find a solution to this?
@karthisiva hi, not for now
@furiosFast Okay
@furiosFast
You could check against Device.current.diagonal
if Int(Device.current.diagonal) == 4 {
// Your code
}
The conversion to Int
is because of floating point precision. If you would check for Device.iPhone12Pro.diagional
(which is 6.1), you would have to convert it to a string and check against that value because it's not a round number.
if String(format: "%.1f", Device.current.diagonal) == "6.1" {
// Your code
}
Actually implementing functions with Device.current.has4InchScreen
would clutter up the API very much because of the great number of different screen sizes there are.
Hello, first of all, excellent library !! I am writing to ask you if it would be possible to add support to the device family based on the inch of the screen, for example:
if Device.current.has4Inch {}
thanks