Hey DEV community! ๐ I'm Gamya, an iOS developer and new here on DEV. So excited to be part of my first ever Game Jam! ๐ Hope you enjoy it! ๐
๐ What I Built
Pride Trivia & Alan Turing Edition is an iOS trivia game built entirely with SwiftUI that celebrates two incredibly important themes this June:
- ๐ณ๏ธโ๐ Pride Month โ honouring LGBTQIA+ history, identity, and resilience
- ๐ป Alan Turing โ the father of modern computing, who was tragically prosecuted for being gay in 1952
The game challenges players with 10 multiple choice questions covering Pride history and Alan Turing's extraordinary legacy โ with fun facts after every answer so you walk away having learned something new every time you play.
๐ฎ Demo Video
https://youtube.com/shorts/cuF7QwYrt50?feature=share
๐น Please see the demo video attached to this submission showing the full game flow from welcome screen through to results.
โจ Features
- ๐ Rainbow themed UI โ deep purple background with full rainbow gradient accents throughout
- ๐ฑ 10 trivia questions covering Pride history and Alan Turing's life and legacy
- ๐ Shuffled questions โ different order every time you play
- โ Instant feedback โ green for correct, red for wrong
- ๐ก Fun facts after every answer โ so every wrong answer is a learning moment
- ๐ Live score tracking in gold with rainbow progress bar
- ๐ Results screen with personalised message based on your score
- ๐ Play Again button to restart instantly
- ๐ค Share Score button to share your results
- ๐ฌ Alan Turing quote on the results screen โ a tribute to his incredible mind
๐ฏ Connection to the June Theme
June is a month of profound meaning:
Pride Month celebrates LGBTQIA+ identity, history, and the ongoing fight for equality. The Stonewall Riots of 1969, the first Pride marches of 1970, the rainbow flag designed by Gilbert Baker in 1978 โ this history deserves to be known and celebrated.
Alan Turing was born in June 1912. He was the genius who cracked the Enigma Code during World War II โ work that is estimated to have shortened the war by two to four years and saved millions of lives. He also laid the foundations of modern computer science. And yet he was prosecuted by the British government for being gay and chemically castrated as punishment. He died in 1954 at just 41 years old.
Every smartphone, every computer, every app โ including this one โ exists in part because of Alan Turing. Building a game that celebrates both his intellectual legacy and his identity felt like exactly the right tribute for June. ๐ณ๏ธโ๐๐ป
๐ ๏ธ How I Built It
The game is built entirely with SwiftUI for iOS and structured across five Swift files:
๐ Project Structure
PrideTriviaGame/
โโโ TriviaData.swift โ Question model and all 10 questions
โโโ WelcomeView.swift โ Welcome screen with rainbow UI
โโโ QuestionView.swift โ Question screen with answer logic
โโโ ResultView.swift โ Results screen with score breakdown
โโโ ContentView.swift โ App entry point, controls screen flow
๐ง Key Technical Concepts Used
Structs and Data Modeling
Each question is modeled as a Swift struct:
struct TriviaQuestion {
let question: String
let answers: [String]
let correctIndex: Int
let funFact: String
}
State Management with SwiftUI
The app uses @State and @Binding to manage game flow between screens:
@State private var gameStarted = false
@State private var gameFinished = false
@State private var score = 0
Dynamic UI with ForEach
Answer buttons are generated dynamically from the question data:
ForEach(0..<currentQuestion.answers.count, id: \.self) { index in
Button { } label: { }
}
Rainbow Progress Bar with GeometryReader
GeometryReader { geo in
RoundedRectangle(cornerRadius: 5)
.fill(LinearGradient(
colors: [.red, .orange, .yellow, .green, .blue, .purple],
startPoint: .leading,
endPoint: .trailing
))
.frame(width: geo.size.width * CGFloat(currentIndex + 1) / CGFloat(questions.count))
}
Shuffled Questions
let triviaQuestions: [TriviaQuestion] = [ ... ].shuffled()
One line makes the question order random every single game! ๐ฒ
Score Based Result Messages
var resultMessage: (emoji: String, title: String, message: String) {
switch percentage {
case 90...100: return ("๐", "Outstanding!", "...")
case 70...89: return ("๐", "Excellent!", "...")
case 50...69: return ("โญ", "Well Done!", "...")
default: return ("๐ฑ", "Keep Learning!", "...")
}
}
๐ Source Code
GitHub: github.com/gamya-hub/PrideTriviaGame
๐ญ What I Learned
Building this game taught me so much โ not just about SwiftUI but about the history I was writing questions about. Learning about Alan Turing's story while building an app that literally runs on the foundations he created was a deeply meaningful experience.
The June Solstice is a moment of transition โ from one season to the next. In the same way, Pride Month and Alan Turing's legacy remind us how far we've come and how much further we still need to go. This game is a small tribute to that journey. ๐
๐ณ๏ธโ๐ Happy Pride Month!
"We can only see a short distance ahead, but we can see plenty there that needs to be done."
โ Alan Turing
Top comments (2)
Thanks for posting ๐(โ โโ แดโ โโ โฟโ )
Thank you so much! ๐ธ Really happy to finally have it out there.