Reference to a TableView Delegate Object within a Scene in Swift 4
Reference to a TableView Delegate Object within a Scene in Swift 4 I have a tableview in a SpriteKit scene. Using a tableview delegate method, I like to pass to another scene/ViewController, which cell was selected. There is only a single storyboard as this is entirely a SpriteKit game. //TableView inside Scene & Delegate Protocol: protocol gameSelectedDelegate { func theGameSelected(gameInt: Int) } class GamesTableView: UITableView, UITableViewDelegate,UITableViewDataSource { //Test Data var items: [String] = ["Player1", "Player2"] let defaults = UserDefaults.standard var gamesList = [Game]() var passedGame: Int? //instance of delegate var selectionDelegate: gameSelectedDelegate!` //GameScene to receive tableview data and delegate for my tableview class GamePlay: SKScene, gameSelectedDelegate { var backButton = SKLabelNode(fontNamed: "ArialRoundedMTBold") var score = SKLabelNode(fontNamed: "ArialRoundedMTBold") var passedGame = 0 //Not gett...