Check out example codes for "swift get device screen size". It will help you in understanding the concepts better.
Code Example 1
let screenSize: CGRect = UIScreen.main.bounds
Code Example 2
let screenSize: CGRect = UIScreen.main.bounds
Learn ReactJs, React Native from akashmittal.com