79425293

Date: 2025-02-09 16:57:21
Score: 7.5 🚩
Natty:
Report link

I am having the same problem now. I am following the advice but GameViewController is not able to see variables in the GameScene.

class GameScene: SKScene, SKPhysicsContactDelegate, GameSceneDelegate { weak var gameViewController: GameViewController? @State var selectedMusic: String?

override func viewDidLoad() {
    super.viewDidLoad()
    
    if let view = self.view as! SKView? {
        
        if let scene = SKScene(fileNamed: "GameScene") {
            scene.gameViewController = self
            scene.scaleMode = .aspectFill
            view.presentScene(scene)
        }
        
        view.ignoresSiblingOrder = true
    }
}

Value of type 'SKScene' has no member 'gameViewController'

What is the fix for this?

Reasons:
  • RegEx Blacklisted phrase (1.5): fix for this?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): I am having the same problem
  • Ends in question mark (2):
  • User mentioned (1): @State
  • Looks like a comment (1):
  • Low reputation (0.5):
Posted by: Dan Selig