A quiz app where you can train answering questions on different topics.
Flexibile and scalable: it can be easily adapted to any topic, be it school tests, interview preparation simulators or just entertaining quizzes.
The quiz includes themes:
- Music
- Tech
- Culture
- Politics
Swift, UIKit + SwiftUI, Coordinator-led MVP, unidirectional state, SwiftData
The source tree is organized by feature, with application composition in App,
shared infrastructure in Core, framework-independent models and contracts in
Domain, and screen ownership in Features. UIKit remains the navigation and
interaction shell; SwiftUI is used where declarative content has a clear size and
maintenance benefit.
The app uses AppMetrica 6.4.0 for product analytics, sessions, crashes, and sanitized operational errors. Advertising attribution, IDFA, location, user profiles, and automatic revenue tracking are disabled.
- Register the iOS app in AppMetrica and copy its API key from Settings → Main.
- In Xcode, select the
Quizicetarget and open Build Settings. - Keep the user-defined
APPMETRICA_API_KEYsetting synchronized for Debug and Release so local sessions and production sessions reach the same app.
The value is substituted into the AppMetricaAPIKey entry in Info.plist.
An empty value or the placeholder leaves analytics disabled. XCTest and SwiftUI
Previews also skip SDK activation.
Events cover screen views, theme selection, quiz start/answers/timeouts/exit/ completion, result actions, statistics, AI generation, and settings changes. Question text, answer text, AI prompts, localized error messages, and generated AI theme IDs are never sent.
AppMetrica 6.4.0 provides its own Privacy Manifest. App Store Connect privacy
answers should still declare the diagnostics and other analytics data collected
by the SDK. Because AppMetricaAdSupport is not linked, the app does not use
AppMetrica cross-app tracking and does not request ATT permission.
The AI quiz generator calls the saved Yandex AI Studio agent only in Debug builds.
- In Agent Atelier, set the agent response format to JSON Schema using
docs/yandex-ai-quiz-schema.json. Usedocs/yandex-ai-quiz-prompt.mdas the agent instruction prompt. The agent input is a JSON string withtheme,locale,questionCount, anddifficulty. Supported question counts are 5, 10, and 15. Difficulty values areeasy(common facts and direct wording),medium(moderate knowledge and plausible distractors), andhard(specialized details without trick questions). A successful response usesstatus: "success"and returns exactlyquestionCountquestions. A policy refusal usesstatus: "refused", a safe diagnosticmessage, empty theme fields, and an emptyquestionsarray. - Create an AI Studio API key and keep it outside the repository.
- In Xcode, open Product → Scheme → Manage Schemes…, duplicate
QuiziceasQuizice Local, and make sure the duplicate is not shared. Its file will live under the git-ignoredxcuserdatadirectory. - Edit the local scheme, open Run → Arguments, and add the enabled
environment variable
YANDEX_AI_API_KEYwith the API-key secret as its value.
The first Debug launch reads the key from the Xcode environment and stores it in the device Keychain, so later Debug launches work without Xcode. The key is never stored in source control. Release builds do not perform direct AI Studio calls; use an authenticated backend proxy before enabling this feature in production.
