Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

xcode how to get aspect ratio of device

let deviceWidth = UIScreen.main.bounds.width * UIScreen.main.scale
let deviceHeight = UIScreen.main.bounds.height * UIScreen.main.scale
let testDeviceAspectRatio = deviceHeight / deviceWidth
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #xcode #aspect #ratio #device
ADD COMMENT
Topic
Name
9+3 =