Xcode error with SpriteKit

Hello to everyone,

i am a begginer of Swift coding,


i have been studying SpriteKit by watching this tutorial on YouTube: https://www.youtube.com/watch?v=EmN9NjrrrWs&t=1s


When i add the ground at the view's center position and then i run the simulator (iPhone 7 ), Xcode gives me an unexpected error that i will show you in these screenshots:

GameScene.swift file: j7apmg.jpg

GameViewController.swift file: qoinsx.jpg


I really hope that someone more expert than me will be able to solve this error so that i will can continue my studies.


Best regards.

I would just switch that view.center code to any other CGPoint value. You could use

CGPoint(x: self.view.bounds.size.width / 2, y: self.view.bounds.size.height / 2 )

Xcode error with SpriteKit
 
 
Q