I'm struggling trying to present a view controller called GameEndViewController, I have created in main.storyboard with som buttons and labels using auto layout from a SKScene called PlayGameScene. I don't know how to use NSNotificationCenter to make the GameViewController present the GameEndViewController.
Can anybody tell me how to use NSNotificationCenter to present the GameEndViewController from the PlayGameScene using swift, or link me to a site where I can learn it?
Thanks in advance!
You do not use NSNotificationCenter to present new views. NSNotifications can be used for one part of your app to tell another part of your app that something asynchronous happened, but that does not sound like what you are asking for.
To present a new view controller when your game ends create a segue to it in storyboard and then trigger that segue programatically as described in this SO answer.
However, as an alternative, consider remaining in the same view controller and instead presenting a 'game end' SKSCene in your SKView as that may give a better user experience.