'How can I modify the size of SpriteKit nodes in Swift?

In my app, for one screen, I am setting the size and centering the background of a SpriteKit node. For example, I'm setting the size of the background subview as follows:

backgroundNode.size = self.frame.size  

While this is working on the iPhone 6 Plus, the smaller screen/lower resolution of the iPhone 5 means the default size of the other nodes makes is too large to fit within their scene.

How can I force other nodes conform to the size of the background node? I wanted to divide each subview's size by the background subview's size, but math operations can't be done directly on the size property.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source