I am trying to get size the of the screen connected to apple tv, is it possible? I have been looking into the documentation provided by apple related to UIScreen but couldn't find anything new except nativeBounds which is same as bounds.
let screenSize = UIScreen.mainScreen().bounds.size
let nativeBound = UIScreen.mainScreen().nativeBounds.size
Both of them are giving me output in pixels, but i need the screen/monitor size (inch) as well. So that i could arrange the display accordingly.
Thanks in advance!
First of all,
UIScreen.mainScreen().boundsreturns the size of the screen in points, not pixels. See the docs.UIScreen.mainScreen().nativeBoundsreturns the screen size in pixels.To find the actual screen size (in an absolute unit of size such as inches), you would need to know the physical size of a pixel, and multiply that by the
nativeBounds.However, I don't think iOS has an API to retrieve pixel size.