Make Background Fill Entire SpriteKit Scene
I have seen many questions lately on Stack Overflow from people creating an iOS SpriteKit game project and having black bars on the edges of the screen.
The cause of the issue is a bug in Xcode’s iOS game project template. When you create the project, the project does not include a storyboard for the launch screen. If you create a multiplatform game project, you will see a file called LaunchScreen.storyboard
in the project navigator. This storyboard file is missing in the iOS template. Without a launch screen storyboard, the scene size defaults to 320 by 480 pixels, giving you black bars on the edges of the screen.
To fix the issue you must set a storyboard as the launch screen file. Fortunately the iOS game project has a main storyboard to use as the launch screen file. To set the launch screen file, perform the following steps:
- Select the project from the project navigator on the left side of the project window to open the project editor.
- Select the app target from the target list in the project editor.
- Click the General button at the top of the project editor.
- Choose Main from the Launch Screen File combo box in the App Icons and Launch Images section.