skip to Main Content

Xcode – Did touch function not working in SpriteKit

import SpriteKit class GameScene: SKScene { var cam: SKCameraNode? var player: SKSpriteNode? override func didMove(to view: SKView) { super.didMove(to: view) cam = SKCameraNode() self.camera = cam self.addChild(cam!) player = self.childNode(withName: "player") as? SKSpriteNode } func touchesBegan(touches: NSSet, withEvent event: UIEvent)…

VIEW QUESTION

Xcode – How to show a specific UIViewController when GKGameCenterViewController is dismissed?

I am presenting a GKGameCenterViewController in an SKScene that inherits from the following protocol. protocol GameCenter {} extension GameCenter where Self: SKScene { func goToLeaderboard() { let vc = GKGameCenterViewController() vc.gameCenterDelegate = GameViewController() vc.viewState = .leaderboards vc.leaderboardIdentifier = "leaderboard" view?.window?.rootViewController?.present(vc,…

VIEW QUESTION
Back To Top
Search