I need to log the screen size of my iOS device. ``...
# multiplatform
j
I need to log the screen size of my iOS device.
Copy code
UIScreen.mainScreen.bounds.size
bounds
should be a
CGRect
and
size
should be a
CGSize
, but
size
is an
Int
. This seems like a bug. Any other ways to get the screen size?
m
The bounds is coming back as a
CValue
and the
size
property is the number of bytes in the value. Need to use
useContents
to get to the actual
CGRect
object.
j
Didn’t know about useContents. That works. Thanks!