Skip to content

iOS Quiz Challenge - João Marcus#220

Open
kiyo92 wants to merge 13 commits into
dynamox-s-a:mainfrom
kiyo92:joao-marcus-dionisio
Open

iOS Quiz Challenge - João Marcus#220
kiyo92 wants to merge 13 commits into
dynamox-s-a:mainfrom
kiyo92:joao-marcus-dionisio

Conversation

@kiyo92

@kiyo92 kiyo92 commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Implemented the iOS Quiz Challenge app with a SwiftUI-based quiz flow, API integration, local persistence, ranking, result screen, timer-based scoring, unit tests, snapshot tests, and project documentation.

What Was Implemented

  • Nickname entry flow before starting the quiz.
  • 10-question quiz flow.
  • Question loading via GET /question.
  • Answer validation via POST /answer?questionId=$id.
  • Visual feedback for correct/incorrect answers before moving to the next question.
  • 120-second quiz timer.
  • Automatic quiz finish when the timer reaches zero.
  • Final score calculation using correctAnswers * remainingSeconds.
  • Result screen with saved score feedback and restart option.
  • Ranking screen with locally persisted best score per nickname.
  • Local persistence using UserDefaults.
  • Dependency injection for app services.
  • Feature-based architecture with Configurator, Interactor, Presenter, Router, View/ViewState, Domain, and Service layers.
  • Unit tests for main business logic.
  • Unit-style snapshot tests for key views/components.
  • README with setup, test, architecture, and product decision notes.

Product Decisions

  • The ranking stores the best score per nickname instead of every quiz attempt, providing a clearer leaderboard experience.
  • The main UI is implemented with SwiftUI.
  • Snapshot tests instantiate views/components directly with mocks/spies instead of running end-to-end UI navigation.

Testing

  • Added/updated tests for quiz flow, timer finish, scoring, persistence, result, ranking, and entry use cases.
  • Added snapshot coverage for entry, quiz options, result, and ranking views.

Notes

  • The quiz API host is https://quiz-api-bwi5hjqyaq-uc.a.run.app.
  • To simulate the error state, temporarily change the question endpoint path from question to an invalid path in QuizService.swift.

Visual Reference

image

Screenshots

image image image image image

kiyo92 added 13 commits July 13, 2026 02:19
- Adding Cocoapods
- Adding Design System module
- Creating the first component
- Creating Quiz Screen
- Creating network layer module
- Configuring dependencies for main app
- Registering network dependency
- Implementing VIP-RC architecture for Quiz View
- Creating service and use case
Fixing selectedOptionID source of truth
Creating Ranking VIP
Creating Result VIP
Storing results on userDefaults
Creating some test cases for all features of the app (TODO: Add Service layer and Navigation tests)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant