Leaderboards
Compete across daily, weekly, monthly, and all-time periods. Submit scores, query rankings, and get sorted snapshots — all backed by SwiftData with CloudKit sync.Periods
PrismLeaderboardPeriod
Submitting Scores
Submit Score
- Creates a new record if none exists for the user/period pair
- Updates the existing record if one exists
- Returns the entry with its computed rank
Updating Scores
Update Score
Querying the Leaderboard
Leaderboard Snapshot
Rank Lookup
Single User Rank
PrismLeaderboardEntry
Sendable, Comparable (by rank ascending), and Identifiable:
Sorting
PrismLeaderboardSnapshot
Resetting
Reset Period
Leaderboard Events
Events
submitScore and updateScore.
Multi-Period Pattern
Submit to Multiple Periods