I have been making a game in SpriteKit and I have come into a problem when supporting all screen sizes. I attempted to resolve the problem by setting all my scenes scale modes to .AspectFill and setting a fixed size for all screens with a width of 480 and a height of 800 as shown:
let scene = GameScene(size:CGSize(width: 480, height: 800))
I went to add a border (an SKShapeNode) that aligns to the edges of the game scene and I found that self.frame.width and self.frame.height aren't don't give the dimensions for the device's visible area. After a bit of research I had discovered a lot of suggestions by using UIScreen.mainScreen().bounds.height and UIScreen.mainScreen().bounds.width. I implemented this way of getting visible screen dimensions instead and it still gave me dimensions that didn't match the actual size of the scene of which is visible to the player.
I am unsure if it has anything to do with the fact that all my scenes no matter the device's resolution have a fixed width and height and are scaled using .AspectFill. I have been stuck on the problem of supporting all screen sizes for a while now and I am unsure of how to go about it. If it helps I am using vector graphic files rather than PNG's. So my questions are: Is there any quick way of supporting all screen sizes or do I have to resort to hardcoding the coordinates of every node on my scenes for every device? I can't see why this would be the solution as it seems too tedious and the code would look messy.
I am also asking about how to get a rectangle/frame that gives the dimensions of the scenes visible area on a device after the scene has been scaled?
I am sorry if either of my questions have been asked before but every answer I find either doesn't solve my problem specifically or seems too messy to write. I think I have given enough information towards the problem but if I haven't please ask me for the required information.
Thank you so much and any help is appreciated