1

I’m integrating achievements and leaderboards into my SwiftUI app and would like to present the Game Center dashboard directly from within SwiftUI. However, it seems the only supported way to show the dashboard is through present(_:animated:) on a UIViewController.

I attempted to wrap the Game Center view in a UIViewControllerRepresentable, but the new iOS 26 Game Center dashboard behaves more like a system overlay than a normal view, which results in visual glitches and generally unstable behavior when presented this way.

Has anyone successfully presented the Game Center dashboard from SwiftUI, or found a clean approach to handling view-controller-based presentations for this kind of system UI? Any guidance or examples would be appreciated.

1
  • 1
    The Game Center access point still works, so this provides a possible way to launch the dashboard. However, as you say, wrapping GKGameCenterViewController with a UIViewControllerRepresentable does not seem to work well with iOS 26. Commented Nov 25 at 12:44

1 Answer 1

0

The Game Center Dashboard can also be opened through the system Access Point. It behaves like a system overlay, and Apple tied the presentation to the Access Point being active at the moment you call trigger(). Trick is when you turn the Access Point on for a moment, call trigger(), and as soon as the system starts opening the dashboard, you immediately turn it off again. Because of that, the floating bubble never appears, but the Dashboard still opens normally.

import SwiftUI
import GameKit

struct ContentView: View {
    var body: some View {
        VStack(spacing: 20) {
            Button("Login Game Center") {
                GKLocalPlayer.local.authenticateHandler = { vc, error in
                    if let vc {
                        UIApplication.shared.connectedScenes
                            .compactMap { $0 as? UIWindowScene }
                            .first?.windows.first?
                            .rootViewController?
                            .present(vc, animated: true)
                    }
                }
            }
            
            Button("Show Dashboard") {
                let ap = GKAccessPoint.shared
                ap.isActive = true   // enabled so trigger will work
                ap.trigger {
                    ap.isActive = false   // disable immediately so the bubble won't appear
                }
            }
        }
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.