I am a beginner programmer and have been trying to teach myself to program a basic app online. I am currently trying to make Tetris on iOS using Swift 2 and Xcode 7. However, I am having trouble changing views. I began with the iOS Game template and have a view named GameViewController which my game runs inside. When the user loses, I want to switch from that view to one called EndGameView, which I have created in the storyboard and linked to the class EndGameView. My issue is that I do not know how to present the EndGameView programmatically without using, for example, a button added in using the storyboard and then control-dragging to the EndGameView.
let endGameView = EndGameView()
super.presentViewController(endGameView, animated: true, completion: nil)
Please excuse my stupidity as I'm sure I'm making a dumb error and thanks for any help.