# Opening Game Center Leaderboard from SKscene

**URL:** <https://forums.kodeco.com/t/opening-game-center-leaderboard-from-skscene/16765>\
**Category:** 2D iOS & tvOS Games by Tutorials\
**Created:** [June 30, 2016, 8:07pm UTC](https://forums.kodeco.com/t/opening-game-center-leaderboard-from-skscene/16765 "2016-06-30T20:07:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfeg](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/dfeg/32/24260_2.png) [@dfeg](https://forums.kodeco.com/u/dfeg)\
**Post date:** [June 30, 2016, 8:07pm UTC](https://forums.kodeco.com/t/opening-game-center-leaderboard-from-skscene/16765/1 "2016-06-30T20:07:14Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![befny](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/befny/32/81494_2.png) [@befny](https://forums.kodeco.com/u/befny)\
**Post date:** [July 2, 2016, 10:07am UTC](https://forums.kodeco.com/t/opening-game-center-leaderboard-from-skscene/16765/2 "2016-07-02T10:07:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dfeg](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/dfeg/32/24260_2.png) [@dfeg](https://forums.kodeco.com/u/dfeg)\
**Post date:** [July 13, 2016, 9:26am UTC](https://forums.kodeco.com/t/opening-game-center-leaderboard-from-skscene/16765/3 "2016-07-13T09:26:32Z")

</div>

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

> **[Game Development with Swift](https://www.oreilly.com/library/view/game-development-with/9781783550531/ch10s03.html)**
>
> Opening Game Center in our game If the user is authenticated, we will add a button to the MenuScene class so they can open the leaderboard and view achievements from … - Selection from Game Development with Swift \[Book\]

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 ?
