View in English

  • Apple Developer
    • Get Started

    Explore Get Started

    • Overview
    • Learn
    • Apple Developer Program

    Stay Updated

    • Latest News
    • Hello Developer
    • Platforms

    Explore Platforms

    • Apple Platforms
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    Featured

    • Design
    • Distribution
    • Games
    • Accessories
    • Web
    • Home
    • CarPlay
    • Technologies

    Explore Technologies

    • Overview
    • Xcode
    • Swift
    • SwiftUI

    Featured

    • Accessibility
    • App Intents
    • Apple Intelligence
    • Games
    • Machine Learning & AI
    • Security
    • Xcode Cloud
    • Community

    Explore Community

    • Overview
    • Meet with Apple events
    • Community-driven events
    • Developer Forums
    • Open Source

    Featured

    • WWDC
    • Swift Student Challenge
    • Developer Stories
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Centers
    • Documentation

    Explore Documentation

    • Documentation Library
    • Technology Overviews
    • Sample Code
    • Human Interface Guidelines
    • Videos

    Release Notes

    • Featured Updates
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • Downloads

    Explore Downloads

    • All Downloads
    • Operating Systems
    • Applications
    • Design Resources

    Featured

    • Xcode
    • TestFlight
    • Fonts
    • SF Symbols
    • Icon Composer
    • Support

    Explore Support

    • Overview
    • Help Guides
    • Developer Forums
    • Feedback Assistant
    • Contact Us

    Featured

    • Account Help
    • App Review Guidelines
    • App Store Connect Help
    • Upcoming Requirements
    • Agreements and Guidelines
    • System Status
  • Quick Links

    • Events
    • News
    • Forums
    • Sample Code
    • Videos
 

Videos

Abrir menú Cerrar menú
  • Colecciones
  • Todos los videos
  • Información

Más videos

  • Información
  • Código
  • Tap into Game Center: Leaderboards, Achievements, and Multiplayer

    Level up your Game Center integration and enable players to compare scores on leaderboards, earn valuable achievements, and engage with other players. Organize special events like weekly championships, daily showdowns, or 1-hour competitions using recurring leaderboards. Create up to 100 unique achievements for your game. And we'll show you how to set up real-time or turn-based multiplayer matches for your Game Center players.

    If you want to learn more about Game Center's interface, Dashboard, and player profiles, check out “Tap into Game Center: Dashboard, Access Point, and Profile.”

    And for more about preparing your game's interface for these new capabilities, see “Design for Game Center.”

    Recursos

      • Video HD
      • Video SD

    Videos relacionados

    Tech Talks

    • Manage Game Center with the App Store Connect API

    WWDC22

    • Plug-in and play: Add Apple frameworks to your Unity game projects
    • Reach new players with Game Center dashboard

    WWDC21

    • Bring Recurring Leaderboards to your game
    • What’s new in Game Center: Widgets, friends, and multiplayer improvements

    WWDC20

    • Design for Game Center
    • Tap into Game Center: Dashboard, Access Point, and Profile
  • Buscar este video…
    • 4:05 - Submitting a score

      // Use the class method to submit score to one or more leaderboards at once
      GKLeaderboard.submitScore(self.points, context: 0, player: GKLocalPlayer.local,
          leaderboardIDs: ["my.leaderboard.id"]) { error in
      }
    • 4:30 - Submitting a score - recurring leaderboard ID

      // Use the class method to submit score to one or more leaderboards at once
      GKLeaderboard.submitScore(self.points, context: 0, player: GKLocalPlayer.local,
          leaderboardIDs: ["my.recurring.leaderboard.id"]) { error in
      }
    • 4:48 - Submitting to a specific occurrence of a recurring leaderboard

      // Submitting to a specific occurrence of a recurring leaderboard
      GKLeaderboard.loadLeaderboards(IDs:["my.recurring.leaderboard.id"]) { (fetchedLBs, error) in
          if let lb = fetchedLBs?.first {
             lb.submitScore(self.points, context: 0, player: GKLocalPlayer.local) { error in
             }
          }
      }
    • 5:33 - Launching in-game UI

      // Launching in-game UI
      
      // Display a list of leaderboards
      let vc = GKGameCenterViewController(
                   state: .leaderboards)
      vc.gameCenterDelegate = self
      present(vc, animated: true, completion: nil)
      
      
      // Or directly display scores for a specific leaderboard
      let vc = GKGameCenterViewController(
                   leaderboardID: "YOUR_ASC_LEADERBOARD_ID",
                   playerScope: .global,
                   timeScope: .allTime)
      vc.gameCenterDelegate = self
      present(vc, animated: true, completion: nil)
    • 7:14 - Accessing previous occurrence

      // Accessing previous occurrence
      
      // Load current occurrence of a recurring leaderboard
      GKLeaderboard.loadLeaderboards(IDs:["my.recurring.leaderboard.id"]) { (fetchedLBs, error) in
          if let current = fetchedLBs?.first {
             // Load previous occurrence using the current occurrence
             current.loadPreviousOccurrence { (prevOccurrence, error) in
                 // Do something with the previous occurrence
             }
          }
      }
    • 14:34 - Reporting achievement progress

      if let achievement = GKAchievement(identifier: identifier) {
          achievement.percentComplete = percentComplete
          GKAchievement.report([achievement]) { error in
              if let error = error {
                  print("Error in reporting achievements: \(error)")
              }
          }
      }
    • 16:05 - Displaying Game Center achievements

      // Showing the Game Center achievements page
      
      let viewController = GKGameCenterViewController(state: .achievements)
      viewController.gameCenterDelegate = self
      present(viewController, animated: true)
    • 23:50 - Check if personalized communication is restricted

      // Check if personalized communication is restricted
      if GKLocalPlayer.local.personalizedCommunicationRestricted {
          // Disable UI for Voice chat
      }

Developer Footer

  • Videos
  • WWDC20
  • Tap into Game Center: Leaderboards, Achievements, and Multiplayer
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Downloads
    • Sample Code
    • Videos
    Open Menu Close Menu
    • Help Guides & Articles
    • Contact Us
    • Forums
    • Feedback & Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • Mini Apps Partner Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Read the latest news.
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines