Check out example codes for "xcode macosx have view resize when window size changed". It will help you in understanding the concepts better.
Code Example 1
func createSceneContent() {
scene.scaleMode = .aspectFit
scene.backgroundColor = .black
// Add additional scene contents here.
...
}
Learn ReactJs, React Native from akashmittal.com