Post

Replies

Boosts

Views

Activity

swift
Hey i was trying to build the app in x-code 10 by following the video of x-code3 . can anyone explain what wrong in the code . import UIKit import Foundation enum gameType {     case easy  case medium  case hard  case player2 } class MenuVc : UIViewController {        @IBAction func Player2( sender: Any) {       moveToGame(game: .player2)      }        @IBAction func Easy( sender: Any) {       moveToGame(game: .easy)  }     @IBAction func Medium( sender: Any) {       moveToGame(game: .medium)  }        @IBAction func Hard( sender: Any) {       moveToGame(game: .hard)  }     func moveToGame(game : gameType ) {       let gameVc = self.storyboard?.instantiateViewController(withIdentifier: "gameVc") as! GameViewController        currentGameType = game  // error here Cannot assign value of type 'gameType' to type 'gameType.Type'.        self.navigationController?.pushViewController(gameVc, animated: true)              } }
1
0
243
Apr ’21