Welcome to GuessTheFlag — a beautifully designed iOS game built with SwiftUI that tests your knowledge of world flags while keeping things fun, fast, and educational.
GuessTheFlag is a simple yet addictive flag quiz game where users are challenged to pick the correct flag for a randomly selected country from a set of three choices. With every correct guess, you earn a point — but beware, wrong guesses can cost you! The game ends after 8 attempts, and your final score is displayed, giving you the option to restart and beat your high score.
- 🌍 A vibrant collection of flags from 11 different countries
- 🧠 Randomized flag display and correct answer on each round
- 📊 Score tracking with real-time updates
- ⚡ Fast gameplay with immediate feedback
- 🧃 Elegant and modern UI using SwiftUI with gradients and materials
- 🔄 Replayable design with a restart option after each game
| Gameplay | Correct Answer Alert | Wrong Answer Alert | Final Score Alert |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
- SwiftUI: For designing responsive and modern user interfaces
- Xcode: Project built and run on the latest version of Xcode
- MVVM Pattern (Lightweight): Logic and UI separation for clarity and scalability
- The app randomly selects 3 flags from a shuffled list of 11 countries.
- The name of one country is displayed, and the user must tap the correct flag.
- Feedback is provided instantly — correct or wrong.
- After 8 rounds, a final score alert appears with an option to restart the game.
GuessTheFlag/ ├── Assets.xcassets/ # Country flag images ├── ContentView.swift # Main game logic and UI └── GuessTheFlagApp.swift # Entry point of the app
- Clone the repository:
git clone https://github.com/your-username/GuessTheFlag.git
- Open GuessTheFlag.xcodeproj in Xcode.
- Run the app on a simulator or your connected iOS device.
Add more countries and flags Track high scores locally Add sound effects and animations Add haptic feedback for physical interactions Introduce a difficulty mode or timer



