iOS get physical screen size programmatically?

前端 未结 11 1927
情话喂你
情话喂你 2020-12-15 03:11

Is this possible? I want the number of inches, not the number of pixels. I know it is approximately 160 ppi. But not exactly.

11条回答
  •  时光取名叫无心
    2020-12-15 03:48

    Nobody said about fixedCoordinateSpace. In Swift 3 to get the screen dimensions in a portrait-up orientation you should use: UIScreen.main.fixedCoordinateSpace.bounds

提交回复
热议问题