Opening Game Center Leaderboard from SKscene

In the above book, the game circuit racer uses a viewController to open the gamecenterviewcontroller and show the leaderboard.

Can anyone explain how can it be done from an SKscene and not from a viewController ?

I think Game Centre has to be presented from a view controller. There’s a few ways you could get your scene to ask the view controller to present Game Center.

•Use an NSNotification
•Pass a reference to the view controller to the scene when it is created.

Or maybe you could create a game centre view controller in your scene and present it something like this.

let gcView = **create the game centre view controller

UIApplication.sharedApplication().keyWindow?.rootViewController?.presentViewController(gcView, animated: true, completion: nil)

I haven’t don’t this so I’m not sure but it might help.

Thank you for replying.
the link below shows how to open game center from an SkScene:

I have already tried it (you can sign up and you’ll have a 10 days trial for free in order to see to whole link).
But it didn’t work, I followed the steps as indicated in the link, but when I try in the simulator, some times it shows the game center leaderboard and the “Done” Button on the right but I cant press any button.
Can anyone help regarding this issue ?