├── Quizzo
├── Assets.xcassets
│ ├── Contents.json
│ ├── AppIcon.appiconset
│ │ ├── AppIcon.png
│ │ └── Contents.json
│ ├── Quizzo.imageset
│ │ ├── Contents.json
│ │ └── Quizzo.svg
│ ├── Result_Illustration.imageset
│ │ ├── Contents.json
│ │ └── Result_Illustration.svg
│ ├── AccentColor.colorset
│ │ └── Contents.json
│ ├── Green.colorset
│ │ └── Contents.json
│ └── CardColor.colorset
│ │ └── Contents.json
├── Preview Content
│ └── Preview Assets.xcassets
│ │ └── Contents.json
├── Model
│ ├── CardData.swift
│ ├── Answer.swift
│ └── Trivia.swift
├── QuizzoApp.swift
├── ContentView.swift
├── Components
│ ├── PrimaryButton.swift
│ ├── ResultCardView.swift
│ ├── ProgressBar.swift
│ └── AnswerField.swift
├── Screens
│ ├── SplashScreen.swift
│ ├── WelcomeScreen.swift
│ ├── ResultScreen.swift
│ └── QuestionScreen.swift
└── Network
│ └── QuizzoManager.swift
├── Quizzo.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── xcuserdata
│ └── aritra.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── project.pbxproj
├── README.md
└── LICENSE
/Quizzo/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Quizzo/Preview Content/Preview Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Quizzo/Assets.xcassets/AppIcon.appiconset/AppIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aritra-tech/Quizzo/HEAD/Quizzo/Assets.xcassets/AppIcon.appiconset/AppIcon.png
--------------------------------------------------------------------------------
/Quizzo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Quizzo.xcodeproj/xcuserdata/aritra.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/Quizzo/Model/CardData.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CardData.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 12/04/24.
6 | //
7 |
8 | import Foundation
9 |
10 | struct CardData {
11 | let title: String
12 | let value: Int
13 | }
14 |
--------------------------------------------------------------------------------
/Quizzo/Model/Answer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Answer.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 08/04/24.
6 | //
7 |
8 | import Foundation
9 |
10 | struct Answer: Identifiable {
11 | var id = UUID()
12 | var text: AttributedString
13 | var isCorrect: Bool
14 | }
15 |
--------------------------------------------------------------------------------
/Quizzo/QuizzoApp.swift:
--------------------------------------------------------------------------------
1 | //
2 | // QuizzoApp.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 07/04/24.
6 | //
7 |
8 | import SwiftUI
9 |
10 | @main
11 | struct QuizzoApp: App {
12 | var body: some Scene {
13 | WindowGroup {
14 | SplashScreen()
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Quizzo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "AppIcon.png",
5 | "idiom" : "universal",
6 | "platform" : "ios",
7 | "size" : "1024x1024"
8 | }
9 | ],
10 | "info" : {
11 | "author" : "xcode",
12 | "version" : 1
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Quizzo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Quizzo/Assets.xcassets/Quizzo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "Quizzo.svg",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Quizzo/Assets.xcassets/Result_Illustration.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "Result_Illustration.svg",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Quizzo.xcodeproj/xcuserdata/aritra.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Quizzo.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Quizzo/ContentView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ContentView.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 07/04/24.
6 | //
7 |
8 | import SwiftUI
9 |
10 | struct ContentView: View {
11 | var body: some View {
12 | VStack {
13 | Image(systemName: "globe")
14 | .imageScale(.large)
15 | .foregroundStyle(.tint)
16 | Text("Hello, world!")
17 | }
18 | .padding()
19 | }
20 | }
21 |
22 | #Preview {
23 | ContentView()
24 | }
25 |
--------------------------------------------------------------------------------
/Quizzo/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "color" : {
5 | "color-space" : "extended-srgb",
6 | "components" : {
7 | "alpha" : "1.000",
8 | "blue" : "0.890",
9 | "green" : "0.910",
10 | "red" : "0.929"
11 | }
12 | },
13 | "idiom" : "universal"
14 | }
15 | ],
16 | "info" : {
17 | "author" : "xcode",
18 | "version" : 1
19 | },
20 | "properties" : {
21 | "localizable" : true
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Quizzo/Components/PrimaryButton.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PrimaryButton.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 07/04/24.
6 | //
7 |
8 | import SwiftUI
9 |
10 | struct PrimaryButton: View {
11 |
12 | var text: String
13 | var background: Color = Color("Green")
14 |
15 | var body: some View {
16 | Text(text)
17 | .frame(width: 300, height: 30)
18 | .foregroundStyle(Color(.white))
19 | .padding()
20 | .padding(.horizontal)
21 | .background(background)
22 | .cornerRadius(8)
23 | }
24 | }
25 |
26 | #Preview {
27 | PrimaryButton(text: "Next")
28 | }
29 |
--------------------------------------------------------------------------------
/Quizzo/Components/ResultCardView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ResultCardView.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 12/04/24.
6 | //
7 |
8 | import SwiftUI
9 |
10 | struct ResultCardView: View {
11 |
12 | let card: CardData
13 | var body: some View {
14 | HStack {
15 | Text(card.title)
16 | .font(.system(size: 16, weight: .medium))
17 |
18 | Spacer()
19 |
20 | Text("\(card.value)")
21 | .font(.system(size: 16, weight: .bold))
22 |
23 | }
24 | .padding()
25 | .background(Color("CardColor"))
26 | .cornerRadius(8)
27 | }
28 | }
29 |
30 | #Preview {
31 | ResultCardView(card: CardData(title: "Total Number of questions", value: 10))
32 | }
33 |
--------------------------------------------------------------------------------
/Quizzo/Components/ProgressBar.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ProgressBar.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 07/04/24.
6 | //
7 |
8 | import SwiftUI
9 |
10 | struct ProgressBar: View {
11 |
12 | var progressValue: CGFloat
13 |
14 | var body: some View {
15 | ZStack(alignment: .leading) {
16 | Rectangle()
17 | .frame(maxWidth: 320, maxHeight: 10)
18 | .foregroundStyle(Color(hue: 1.0,
19 | saturation: 0.0, brightness: 0.564, opacity: 0.327))
20 | .cornerRadius(20)
21 |
22 | Rectangle()
23 | .frame(width: progressValue, height: 10)
24 | .foregroundColor(.green)
25 | .cornerRadius(20)
26 | }
27 | }
28 | }
29 |
30 | #Preview {
31 | ProgressBar(progressValue: 70)
32 | }
33 |
--------------------------------------------------------------------------------
/Quizzo/Assets.xcassets/Green.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "color" : {
5 | "color-space" : "extended-srgb",
6 | "components" : {
7 | "alpha" : "1.000",
8 | "blue" : "0.388",
9 | "green" : "0.804",
10 | "red" : "0.192"
11 | }
12 | },
13 | "idiom" : "universal"
14 | },
15 | {
16 | "appearances" : [
17 | {
18 | "appearance" : "luminosity",
19 | "value" : "dark"
20 | }
21 | ],
22 | "color" : {
23 | "color-space" : "extended-srgb",
24 | "components" : {
25 | "alpha" : "1.000",
26 | "blue" : "1.000",
27 | "green" : "1.000",
28 | "red" : "1.000"
29 | }
30 | },
31 | "idiom" : "universal"
32 | }
33 | ],
34 | "info" : {
35 | "author" : "xcode",
36 | "version" : 1
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Quizzo/Assets.xcassets/CardColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "color" : {
5 | "color-space" : "extended-srgb",
6 | "components" : {
7 | "alpha" : "1.000",
8 | "blue" : "0.965",
9 | "green" : "0.953",
10 | "red" : "0.957"
11 | }
12 | },
13 | "idiom" : "universal"
14 | },
15 | {
16 | "appearances" : [
17 | {
18 | "appearance" : "luminosity",
19 | "value" : "dark"
20 | }
21 | ],
22 | "color" : {
23 | "color-space" : "extended-srgb",
24 | "components" : {
25 | "alpha" : "1.000",
26 | "blue" : "1.000",
27 | "green" : "1.000",
28 | "red" : "1.000"
29 | }
30 | },
31 | "idiom" : "universal"
32 | }
33 | ],
34 | "info" : {
35 | "author" : "xcode",
36 | "version" : 1
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Quizzo/Screens/SplashScreen.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SplashScreen.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 10/04/24.
6 | //
7 |
8 | import SwiftUI
9 |
10 | struct SplashScreen: View {
11 |
12 | @State private var isActive: Bool = false
13 |
14 | var body: some View {
15 | ZStack {
16 | if self.isActive {
17 | WelcomeScreen()
18 | } else {
19 |
20 | Image("Quizzo")
21 | .resizable()
22 | .scaledToFit()
23 | .frame(width: 240, height: 240)
24 |
25 | }
26 | }
27 | .onAppear {
28 | DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) {
29 | withAnimation {
30 | self.isActive = true
31 | }
32 | }
33 | }
34 | .frame(maxWidth: .infinity, maxHeight: .infinity)
35 | .edgesIgnoringSafeArea(.all)
36 | .background(Color("AccentColor"))
37 | }
38 | }
39 |
40 | #Preview {
41 | SplashScreen()
42 | }
43 |
--------------------------------------------------------------------------------
/Quizzo/Model/Trivia.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Trivia.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 08/04/24.
6 | //
7 |
8 | import Foundation
9 |
10 | struct Trivia: Decodable {
11 | var results: [Result]
12 |
13 | struct Result: Decodable, Identifiable {
14 | var id: UUID {
15 | UUID()
16 | }
17 | var category: String
18 | var type: String
19 | var difficulty: String
20 | var question: String
21 | var correctAnswer: String
22 | var incorrectAnswers: [String]
23 |
24 | var formattedQuestion: AttributedString {
25 | do {
26 | return try AttributedString(markdown: question)
27 | } catch {
28 | print("Error setting formatedQuestion: \(error)")
29 | return ""
30 | }
31 | }
32 |
33 | var answer: [Answer] {
34 | do {
35 | let correct = [Answer(text: try AttributedString(markdown: correctAnswer), isCorrect: true)]
36 | let incorrect = try incorrectAnswers.map { answer in
37 | Answer(text: try AttributedString(markdown: answer), isCorrect: false)
38 | }
39 | let allAnswers = correct + incorrect
40 |
41 | return allAnswers.shuffled()
42 | } catch {
43 | print("Error getting Answer: \(error)")
44 | return []
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | 
4 |
5 |
6 |
7 | # Quizzo
8 |
9 | A minimal Quiz iOS application made using SwiftUI and Trivia API
10 |
11 | ## Preview
12 | Welcome Screen | Question Screen | Result Screen
13 | --- | --- | ---
14 |  |  | 
15 |
16 | ## 🛠 Technical Background
17 | - [SwiftUI](https://developer.apple.com/documentation/swiftui/) - SwiftUI is an innovative, exceptionally simple way to build user interfaces across all Apple platforms with the power of Swift.
18 |
19 | ## License
20 | ```
21 | Copyright 2024 Aritra Das
22 |
23 | Licensed under the Apache License, Version 2.0 (the "License");
24 | you may not use this file except in compliance with the License.
25 | You may obtain a copy of the License at
26 |
27 | http://www.apache.org/licenses/LICENSE-2.0
28 |
29 | Unless required by applicable law or agreed to in writing, software
30 | distributed under the License is distributed on an "AS IS" BASIS,
31 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32 | See the License for the specific language governing permissions and
33 | limitations under the License.
34 | ```
35 |
--------------------------------------------------------------------------------
/Quizzo/Screens/WelcomeScreen.swift:
--------------------------------------------------------------------------------
1 | //
2 | // WelcomeScreen.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 07/04/24.
6 | //
7 |
8 | import SwiftUI
9 |
10 | struct WelcomeScreen: View {
11 | @StateObject var quizzoManager = QuizzoManager()
12 |
13 | var body: some View {
14 | NavigationView {
15 | VStack {
16 | VStack(spacing: 30) {
17 | Text("Q")
18 | .font(.system(size: 50, weight: .heavy,design: .default))
19 |
20 |
21 | Text("Welcome to Quizzo")
22 | .font(.title2)
23 | .fontWeight(.medium)
24 |
25 | Text("Are you ready to text out your knowledge and learn some important stuffs")
26 | .font(.subheadline)
27 | .multilineTextAlignment(.center)
28 | .fontWeight(.regular)
29 | }
30 | NavigationLink {
31 | ResultScreen()
32 | .environmentObject(quizzoManager)
33 | } label: {
34 | PrimaryButton(text: "Let's get started!")
35 | .frame(maxWidth: 550)
36 | }
37 | }
38 | .padding()
39 | .frame(maxWidth: .infinity, maxHeight: .infinity)
40 | .edgesIgnoringSafeArea(.all)
41 | .background(Color("AccentColor"))
42 | }
43 | }
44 | }
45 |
46 | #Preview {
47 | WelcomeScreen()
48 | }
49 |
--------------------------------------------------------------------------------
/Quizzo/Screens/ResultScreen.swift:
--------------------------------------------------------------------------------
1 | //
2 | // TriviaScreen.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 08/04/24.
6 | //
7 |
8 | import SwiftUI
9 |
10 | struct ResultScreen: View {
11 | @EnvironmentObject var manager: QuizzoManager
12 |
13 |
14 | var body: some View {
15 | if manager.reachedEnd {
16 | VStack(spacing: 30) {
17 |
18 | Image("Result_Illustration")
19 | .resizable()
20 | .scaledToFit()
21 | .frame(width: 143.78, height: 151.11)
22 |
23 | Text("Results of the Quiz")
24 | .font(.system(size: 22, weight: .bold))
25 | .multilineTextAlignment(.center)
26 |
27 |
28 | VStack {
29 | ResultCardView(card: CardData(title: "TOTAL QUESTIONS", value: manager.length))
30 | ResultCardView(card: CardData(title: "CORRECT QUESTIONS", value: manager.score))
31 | }
32 |
33 | Spacer()
34 |
35 | Button {
36 | Task.init {
37 | await manager.fetchQuestion()
38 | }
39 | } label: {
40 | PrimaryButton(text: "Play Again")
41 | }
42 | }
43 | .padding()
44 | .frame(maxWidth: .infinity, maxHeight: .infinity)
45 | .background(Color("AccentColor"))
46 | .navigationBarHidden(true)
47 | } else {
48 | QuestionScreen()
49 | .environmentObject(manager)
50 | }
51 | }
52 | }
53 |
54 | #Preview {
55 | ResultScreen()
56 | .environmentObject(QuizzoManager())
57 | }
58 |
--------------------------------------------------------------------------------
/Quizzo/Components/AnswerField.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AnswerField.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 08/04/24.
6 | //
7 |
8 | import SwiftUI
9 |
10 | struct AnswerField: View {
11 | @EnvironmentObject var manager: QuizzoManager
12 | var answer: Answer
13 |
14 | @State private var isSelected = false
15 | var green = Color(hue: 0.437, saturation: 0.711, brightness: 0.711)
16 | var red = Color(red: 0.71, green: 0.094, blue: 0.1)
17 |
18 | var body: some View {
19 | HStack(spacing: 30) {
20 | Image(systemName: "circle")
21 | .font(.caption)
22 |
23 | Text(answer.text)
24 | .font(.system(size: 18))
25 | .foregroundStyle(Color(.black))
26 |
27 | .bold()
28 |
29 | if isSelected {
30 | Spacer()
31 |
32 | Image(systemName: answer.isCorrect ? "checkmark.circle" : "x.circle")
33 | .foregroundStyle(Color(answer.isCorrect ? green : red))
34 | }
35 | }
36 | .padding()
37 | .frame(maxWidth: .infinity, alignment: .leading)
38 | .foregroundStyle(Color(manager.answerSelected ? (isSelected ? Color(.lightGray) : .gray): Color(.lightGray)))
39 | .background(.white)
40 | .cornerRadius(10)
41 | .shadow(color: isSelected ? (answer.isCorrect ? green : red) : .gray ,radius: 5)
42 | .onTapGesture {
43 | if !manager.answerSelected {
44 | isSelected = true
45 | manager.selectedAnswer(answer: answer)
46 | }
47 | }
48 | }
49 | }
50 |
51 | #Preview {
52 | AnswerField(answer: Answer(text: "Question", isCorrect: false))
53 | .environmentObject(QuizzoManager())
54 | }
55 |
--------------------------------------------------------------------------------
/Quizzo/Screens/QuestionScreen.swift:
--------------------------------------------------------------------------------
1 | //
2 | // QuestionScreen.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 07/04/24.
6 | //
7 |
8 | import SwiftUI
9 |
10 | struct QuestionScreen: View {
11 | @EnvironmentObject var manager: QuizzoManager
12 |
13 | var body: some View {
14 | VStack(spacing: 40) {
15 |
16 | HStack {
17 | ProgressBar(progressValue: manager.progress)
18 |
19 | Text("\(manager.index + 1) / \(manager.length)")
20 | .font(.system(size: 14))
21 | .fontWeight(.light)
22 | .foregroundStyle(Color(.lightGray))
23 | }
24 |
25 | VStack(alignment: .leading, spacing: 20) {
26 |
27 | Text(manager.question)
28 | .font(.system(size: 22))
29 | .foregroundStyle(Color(.black))
30 | .bold()
31 | .multilineTextAlignment(.center)
32 |
33 | ForEach(manager.answerChoices, id: \.id) { answer in
34 | AnswerField(answer: answer)
35 | .environmentObject(manager)
36 | }
37 | }
38 |
39 | Spacer()
40 |
41 | Button {
42 | manager.goToNextQuestion()
43 | } label: {
44 | PrimaryButton(text: "Next", background:
45 | manager.answerSelected ? Color("Green") : Color(hue: 1.0, saturation: 0.0, brightness: 0.564, opacity: 0.327))
46 | }
47 | .disabled(!manager.answerSelected)
48 |
49 | Spacer()
50 | }
51 | .padding()
52 | .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
53 | .background(Color("AccentColor"))
54 | .navigationBarHidden(true)
55 | }
56 | }
57 |
58 | #Preview {
59 | QuestionScreen()
60 | .environmentObject(QuizzoManager())
61 | }
62 |
--------------------------------------------------------------------------------
/Quizzo/Network/QuizzoManager.swift:
--------------------------------------------------------------------------------
1 | //
2 | // QuizzoManager.swift
3 | // Quizzo
4 | //
5 | // Created by Aritra on 08/04/24.
6 | //
7 |
8 | import Foundation
9 | import SwiftUI
10 |
11 | class QuizzoManager: ObservableObject {
12 |
13 | private(set) var trivia: [Trivia.Result] = []
14 | @Published private(set) var length = 0
15 | @Published private(set) var index = 0
16 | @Published private(set) var reachedEnd = false
17 | @Published private(set) var answerSelected = false
18 | @Published private(set) var question: AttributedString = ""
19 | @Published private(set) var answerChoices: [Answer] = []
20 | @Published private(set) var progress: CGFloat = 0.0
21 | @Published private(set) var score = 0
22 |
23 | init() {
24 | Task.init {
25 | await fetchQuestion()
26 | }
27 | }
28 |
29 | func fetchQuestion() async {
30 | guard let url = URL(string: "https://opentdb.com/api.php?amount=10")
31 | else { fatalError("Missing URL") }
32 |
33 | let urlRequest = URLRequest(url: url)
34 |
35 | do {
36 | let (data, response) = try await URLSession.shared.data(for: urlRequest)
37 | guard (response as? HTTPURLResponse)?.statusCode == 200 else {
38 | fatalError("Error while fetching data")
39 | }
40 |
41 | let decoder = JSONDecoder()
42 | decoder.keyDecodingStrategy = .convertFromSnakeCase
43 | let decodedData = try decoder.decode(Trivia.self, from: data)
44 |
45 | DispatchQueue.main.async {
46 | self.trivia = decodedData.results
47 | self.length = self.trivia.count
48 | self.setQuestion()
49 | }
50 | } catch {
51 | print("Error while fetching questions: \(error)")
52 | }
53 | }
54 |
55 | func goToNextQuestion() {
56 | if index + 1 < length {
57 | index += 1
58 | setQuestion()
59 | } else {
60 | reachedEnd = true
61 | }
62 | }
63 |
64 | func setQuestion() {
65 | answerSelected = false
66 | progress = CGFloat(Double(index + 1) / Double(length) * 310)
67 |
68 | if index < length {
69 | let currentQuestion = trivia[index]
70 | question = currentQuestion.formattedQuestion
71 | answerChoices = currentQuestion.answer
72 | }
73 | }
74 |
75 | func selectedAnswer(answer: Answer) {
76 | answerSelected = true
77 | if answer.isCorrect {
78 | score += 1
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/Quizzo/Assets.xcassets/Quizzo.imageset/Quizzo.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/Quizzo/Assets.xcassets/Result_Illustration.imageset/Result_Illustration.svg:
--------------------------------------------------------------------------------
1 |
57 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2024 Aritra Das
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/Quizzo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 56;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 9A3447E02BC3F5C7001E7811 /* AnswerField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A3447DF2BC3F5C7001E7811 /* AnswerField.swift */; };
11 | 9A3447E22BC4391C001E7811 /* ResultScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A3447E12BC4391C001E7811 /* ResultScreen.swift */; };
12 | 9A3447E42BC43D0B001E7811 /* Trivia.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A3447E32BC43D0B001E7811 /* Trivia.swift */; };
13 | 9A3447E72BC44263001E7811 /* QuizzoManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A3447E62BC44263001E7811 /* QuizzoManager.swift */; };
14 | 9A42EBC72BC695CA004A30B6 /* SplashScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A42EBC62BC695CA004A30B6 /* SplashScreen.swift */; };
15 | 9A6334F52BC33AFF00336597 /* Answer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6334F42BC33AFF00336597 /* Answer.swift */; };
16 | 9AA2608E2BC2D52D004F5223 /* QuizzoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA2608D2BC2D52D004F5223 /* QuizzoApp.swift */; };
17 | 9AA260902BC2D52D004F5223 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA2608F2BC2D52D004F5223 /* ContentView.swift */; };
18 | 9AA260922BC2D52E004F5223 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9AA260912BC2D52E004F5223 /* Assets.xcassets */; };
19 | 9AA260952BC2D52E004F5223 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9AA260942BC2D52E004F5223 /* Preview Assets.xcassets */; };
20 | 9AA2609D2BC2D5F9004F5223 /* PrimaryButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA2609C2BC2D5F9004F5223 /* PrimaryButton.swift */; };
21 | 9AA260A02BC2D919004F5223 /* WelcomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA2609F2BC2D919004F5223 /* WelcomeScreen.swift */; };
22 | 9AA260A22BC2DBF1004F5223 /* QuestionScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA260A12BC2DBF1004F5223 /* QuestionScreen.swift */; };
23 | 9AA260A42BC2DE49004F5223 /* ProgressBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA260A32BC2DE49004F5223 /* ProgressBar.swift */; };
24 | 9AAFC0062BC9767700CBAAF0 /* CardData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AAFC0052BC9767700CBAAF0 /* CardData.swift */; };
25 | 9AAFC0082BC976CC00CBAAF0 /* ResultCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AAFC0072BC976CC00CBAAF0 /* ResultCardView.swift */; };
26 | /* End PBXBuildFile section */
27 |
28 | /* Begin PBXFileReference section */
29 | 9A3447DF2BC3F5C7001E7811 /* AnswerField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnswerField.swift; sourceTree = ""; };
30 | 9A3447E12BC4391C001E7811 /* ResultScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultScreen.swift; sourceTree = ""; };
31 | 9A3447E32BC43D0B001E7811 /* Trivia.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Trivia.swift; sourceTree = ""; };
32 | 9A3447E62BC44263001E7811 /* QuizzoManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuizzoManager.swift; sourceTree = ""; };
33 | 9A42EBC62BC695CA004A30B6 /* SplashScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashScreen.swift; sourceTree = ""; };
34 | 9A6334F42BC33AFF00336597 /* Answer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Answer.swift; sourceTree = ""; };
35 | 9AA2608A2BC2D52D004F5223 /* Quizzo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Quizzo.app; sourceTree = BUILT_PRODUCTS_DIR; };
36 | 9AA2608D2BC2D52D004F5223 /* QuizzoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuizzoApp.swift; sourceTree = ""; };
37 | 9AA2608F2BC2D52D004F5223 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; };
38 | 9AA260912BC2D52E004F5223 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
39 | 9AA260942BC2D52E004F5223 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; };
40 | 9AA2609C2BC2D5F9004F5223 /* PrimaryButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrimaryButton.swift; sourceTree = ""; };
41 | 9AA2609F2BC2D919004F5223 /* WelcomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeScreen.swift; sourceTree = ""; };
42 | 9AA260A12BC2DBF1004F5223 /* QuestionScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionScreen.swift; sourceTree = ""; };
43 | 9AA260A32BC2DE49004F5223 /* ProgressBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressBar.swift; sourceTree = ""; };
44 | 9AAFC0052BC9767700CBAAF0 /* CardData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardData.swift; sourceTree = ""; };
45 | 9AAFC0072BC976CC00CBAAF0 /* ResultCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultCardView.swift; sourceTree = ""; };
46 | /* End PBXFileReference section */
47 |
48 | /* Begin PBXFrameworksBuildPhase section */
49 | 9AA260872BC2D52D004F5223 /* Frameworks */ = {
50 | isa = PBXFrameworksBuildPhase;
51 | buildActionMask = 2147483647;
52 | files = (
53 | );
54 | runOnlyForDeploymentPostprocessing = 0;
55 | };
56 | /* End PBXFrameworksBuildPhase section */
57 |
58 | /* Begin PBXGroup section */
59 | 9A3447E52BC4424D001E7811 /* Network */ = {
60 | isa = PBXGroup;
61 | children = (
62 | 9A3447E62BC44263001E7811 /* QuizzoManager.swift */,
63 | );
64 | path = Network;
65 | sourceTree = "";
66 | };
67 | 9A6334F32BC33ADF00336597 /* Model */ = {
68 | isa = PBXGroup;
69 | children = (
70 | 9A6334F42BC33AFF00336597 /* Answer.swift */,
71 | 9A3447E32BC43D0B001E7811 /* Trivia.swift */,
72 | 9AAFC0052BC9767700CBAAF0 /* CardData.swift */,
73 | );
74 | path = Model;
75 | sourceTree = "";
76 | };
77 | 9AA260812BC2D52D004F5223 = {
78 | isa = PBXGroup;
79 | children = (
80 | 9AA2608C2BC2D52D004F5223 /* Quizzo */,
81 | 9AA2608B2BC2D52D004F5223 /* Products */,
82 | );
83 | sourceTree = "";
84 | };
85 | 9AA2608B2BC2D52D004F5223 /* Products */ = {
86 | isa = PBXGroup;
87 | children = (
88 | 9AA2608A2BC2D52D004F5223 /* Quizzo.app */,
89 | );
90 | name = Products;
91 | sourceTree = "";
92 | };
93 | 9AA2608C2BC2D52D004F5223 /* Quizzo */ = {
94 | isa = PBXGroup;
95 | children = (
96 | 9A3447E52BC4424D001E7811 /* Network */,
97 | 9A6334F32BC33ADF00336597 /* Model */,
98 | 9AA2609E2BC2D8E8004F5223 /* Screens */,
99 | 9AA2609B2BC2D5C8004F5223 /* Components */,
100 | 9AA2608D2BC2D52D004F5223 /* QuizzoApp.swift */,
101 | 9AA2608F2BC2D52D004F5223 /* ContentView.swift */,
102 | 9AA260912BC2D52E004F5223 /* Assets.xcassets */,
103 | 9AA260932BC2D52E004F5223 /* Preview Content */,
104 | );
105 | path = Quizzo;
106 | sourceTree = "";
107 | };
108 | 9AA260932BC2D52E004F5223 /* Preview Content */ = {
109 | isa = PBXGroup;
110 | children = (
111 | 9AA260942BC2D52E004F5223 /* Preview Assets.xcassets */,
112 | );
113 | path = "Preview Content";
114 | sourceTree = "";
115 | };
116 | 9AA2609B2BC2D5C8004F5223 /* Components */ = {
117 | isa = PBXGroup;
118 | children = (
119 | 9AA2609C2BC2D5F9004F5223 /* PrimaryButton.swift */,
120 | 9AA260A32BC2DE49004F5223 /* ProgressBar.swift */,
121 | 9A3447DF2BC3F5C7001E7811 /* AnswerField.swift */,
122 | 9AAFC0072BC976CC00CBAAF0 /* ResultCardView.swift */,
123 | );
124 | path = Components;
125 | sourceTree = "";
126 | };
127 | 9AA2609E2BC2D8E8004F5223 /* Screens */ = {
128 | isa = PBXGroup;
129 | children = (
130 | 9AA2609F2BC2D919004F5223 /* WelcomeScreen.swift */,
131 | 9AA260A12BC2DBF1004F5223 /* QuestionScreen.swift */,
132 | 9A3447E12BC4391C001E7811 /* ResultScreen.swift */,
133 | 9A42EBC62BC695CA004A30B6 /* SplashScreen.swift */,
134 | );
135 | path = Screens;
136 | sourceTree = "";
137 | };
138 | /* End PBXGroup section */
139 |
140 | /* Begin PBXNativeTarget section */
141 | 9AA260892BC2D52D004F5223 /* Quizzo */ = {
142 | isa = PBXNativeTarget;
143 | buildConfigurationList = 9AA260982BC2D52E004F5223 /* Build configuration list for PBXNativeTarget "Quizzo" */;
144 | buildPhases = (
145 | 9AA260862BC2D52D004F5223 /* Sources */,
146 | 9AA260872BC2D52D004F5223 /* Frameworks */,
147 | 9AA260882BC2D52D004F5223 /* Resources */,
148 | );
149 | buildRules = (
150 | );
151 | dependencies = (
152 | );
153 | name = Quizzo;
154 | productName = Quizzo;
155 | productReference = 9AA2608A2BC2D52D004F5223 /* Quizzo.app */;
156 | productType = "com.apple.product-type.application";
157 | };
158 | /* End PBXNativeTarget section */
159 |
160 | /* Begin PBXProject section */
161 | 9AA260822BC2D52D004F5223 /* Project object */ = {
162 | isa = PBXProject;
163 | attributes = {
164 | BuildIndependentTargetsInParallel = 1;
165 | LastSwiftUpdateCheck = 1500;
166 | LastUpgradeCheck = 1500;
167 | TargetAttributes = {
168 | 9AA260892BC2D52D004F5223 = {
169 | CreatedOnToolsVersion = 15.0.1;
170 | };
171 | };
172 | };
173 | buildConfigurationList = 9AA260852BC2D52D004F5223 /* Build configuration list for PBXProject "Quizzo" */;
174 | compatibilityVersion = "Xcode 14.0";
175 | developmentRegion = en;
176 | hasScannedForEncodings = 0;
177 | knownRegions = (
178 | en,
179 | Base,
180 | );
181 | mainGroup = 9AA260812BC2D52D004F5223;
182 | productRefGroup = 9AA2608B2BC2D52D004F5223 /* Products */;
183 | projectDirPath = "";
184 | projectRoot = "";
185 | targets = (
186 | 9AA260892BC2D52D004F5223 /* Quizzo */,
187 | );
188 | };
189 | /* End PBXProject section */
190 |
191 | /* Begin PBXResourcesBuildPhase section */
192 | 9AA260882BC2D52D004F5223 /* Resources */ = {
193 | isa = PBXResourcesBuildPhase;
194 | buildActionMask = 2147483647;
195 | files = (
196 | 9AA260952BC2D52E004F5223 /* Preview Assets.xcassets in Resources */,
197 | 9AA260922BC2D52E004F5223 /* Assets.xcassets in Resources */,
198 | );
199 | runOnlyForDeploymentPostprocessing = 0;
200 | };
201 | /* End PBXResourcesBuildPhase section */
202 |
203 | /* Begin PBXSourcesBuildPhase section */
204 | 9AA260862BC2D52D004F5223 /* Sources */ = {
205 | isa = PBXSourcesBuildPhase;
206 | buildActionMask = 2147483647;
207 | files = (
208 | 9A42EBC72BC695CA004A30B6 /* SplashScreen.swift in Sources */,
209 | 9A3447E02BC3F5C7001E7811 /* AnswerField.swift in Sources */,
210 | 9A3447E22BC4391C001E7811 /* ResultScreen.swift in Sources */,
211 | 9A3447E72BC44263001E7811 /* QuizzoManager.swift in Sources */,
212 | 9A3447E42BC43D0B001E7811 /* Trivia.swift in Sources */,
213 | 9AA2609D2BC2D5F9004F5223 /* PrimaryButton.swift in Sources */,
214 | 9AA260A22BC2DBF1004F5223 /* QuestionScreen.swift in Sources */,
215 | 9AA260902BC2D52D004F5223 /* ContentView.swift in Sources */,
216 | 9A6334F52BC33AFF00336597 /* Answer.swift in Sources */,
217 | 9AA260A02BC2D919004F5223 /* WelcomeScreen.swift in Sources */,
218 | 9AAFC0062BC9767700CBAAF0 /* CardData.swift in Sources */,
219 | 9AA260A42BC2DE49004F5223 /* ProgressBar.swift in Sources */,
220 | 9AA2608E2BC2D52D004F5223 /* QuizzoApp.swift in Sources */,
221 | 9AAFC0082BC976CC00CBAAF0 /* ResultCardView.swift in Sources */,
222 | );
223 | runOnlyForDeploymentPostprocessing = 0;
224 | };
225 | /* End PBXSourcesBuildPhase section */
226 |
227 | /* Begin XCBuildConfiguration section */
228 | 9AA260962BC2D52E004F5223 /* Debug */ = {
229 | isa = XCBuildConfiguration;
230 | buildSettings = {
231 | ALWAYS_SEARCH_USER_PATHS = NO;
232 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
233 | CLANG_ANALYZER_NONNULL = YES;
234 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
235 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
236 | CLANG_ENABLE_MODULES = YES;
237 | CLANG_ENABLE_OBJC_ARC = YES;
238 | CLANG_ENABLE_OBJC_WEAK = YES;
239 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
240 | CLANG_WARN_BOOL_CONVERSION = YES;
241 | CLANG_WARN_COMMA = YES;
242 | CLANG_WARN_CONSTANT_CONVERSION = YES;
243 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
244 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
245 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
246 | CLANG_WARN_EMPTY_BODY = YES;
247 | CLANG_WARN_ENUM_CONVERSION = YES;
248 | CLANG_WARN_INFINITE_RECURSION = YES;
249 | CLANG_WARN_INT_CONVERSION = YES;
250 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
251 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
252 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
253 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
254 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
255 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
256 | CLANG_WARN_STRICT_PROTOTYPES = YES;
257 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
258 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
259 | CLANG_WARN_UNREACHABLE_CODE = YES;
260 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
261 | COPY_PHASE_STRIP = NO;
262 | DEBUG_INFORMATION_FORMAT = dwarf;
263 | ENABLE_STRICT_OBJC_MSGSEND = YES;
264 | ENABLE_TESTABILITY = YES;
265 | ENABLE_USER_SCRIPT_SANDBOXING = YES;
266 | GCC_C_LANGUAGE_STANDARD = gnu17;
267 | GCC_DYNAMIC_NO_PIC = NO;
268 | GCC_NO_COMMON_BLOCKS = YES;
269 | GCC_OPTIMIZATION_LEVEL = 0;
270 | GCC_PREPROCESSOR_DEFINITIONS = (
271 | "DEBUG=1",
272 | "$(inherited)",
273 | );
274 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
275 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
276 | GCC_WARN_UNDECLARED_SELECTOR = YES;
277 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
278 | GCC_WARN_UNUSED_FUNCTION = YES;
279 | GCC_WARN_UNUSED_VARIABLE = YES;
280 | IPHONEOS_DEPLOYMENT_TARGET = 17.0;
281 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
282 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
283 | MTL_FAST_MATH = YES;
284 | ONLY_ACTIVE_ARCH = YES;
285 | SDKROOT = iphoneos;
286 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
287 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
288 | };
289 | name = Debug;
290 | };
291 | 9AA260972BC2D52E004F5223 /* Release */ = {
292 | isa = XCBuildConfiguration;
293 | buildSettings = {
294 | ALWAYS_SEARCH_USER_PATHS = NO;
295 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
296 | CLANG_ANALYZER_NONNULL = YES;
297 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
298 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
299 | CLANG_ENABLE_MODULES = YES;
300 | CLANG_ENABLE_OBJC_ARC = YES;
301 | CLANG_ENABLE_OBJC_WEAK = YES;
302 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
303 | CLANG_WARN_BOOL_CONVERSION = YES;
304 | CLANG_WARN_COMMA = YES;
305 | CLANG_WARN_CONSTANT_CONVERSION = YES;
306 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
307 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
308 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
309 | CLANG_WARN_EMPTY_BODY = YES;
310 | CLANG_WARN_ENUM_CONVERSION = YES;
311 | CLANG_WARN_INFINITE_RECURSION = YES;
312 | CLANG_WARN_INT_CONVERSION = YES;
313 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
314 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
315 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
316 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
317 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
318 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
319 | CLANG_WARN_STRICT_PROTOTYPES = YES;
320 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
321 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
322 | CLANG_WARN_UNREACHABLE_CODE = YES;
323 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
324 | COPY_PHASE_STRIP = NO;
325 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
326 | ENABLE_NS_ASSERTIONS = NO;
327 | ENABLE_STRICT_OBJC_MSGSEND = YES;
328 | ENABLE_USER_SCRIPT_SANDBOXING = YES;
329 | GCC_C_LANGUAGE_STANDARD = gnu17;
330 | GCC_NO_COMMON_BLOCKS = YES;
331 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
332 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
333 | GCC_WARN_UNDECLARED_SELECTOR = YES;
334 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
335 | GCC_WARN_UNUSED_FUNCTION = YES;
336 | GCC_WARN_UNUSED_VARIABLE = YES;
337 | IPHONEOS_DEPLOYMENT_TARGET = 17.0;
338 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
339 | MTL_ENABLE_DEBUG_INFO = NO;
340 | MTL_FAST_MATH = YES;
341 | SDKROOT = iphoneos;
342 | SWIFT_COMPILATION_MODE = wholemodule;
343 | VALIDATE_PRODUCT = YES;
344 | };
345 | name = Release;
346 | };
347 | 9AA260992BC2D52E004F5223 /* Debug */ = {
348 | isa = XCBuildConfiguration;
349 | buildSettings = {
350 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
351 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
352 | CODE_SIGN_STYLE = Automatic;
353 | CURRENT_PROJECT_VERSION = 1;
354 | DEVELOPMENT_ASSET_PATHS = "\"Quizzo/Preview Content\"";
355 | DEVELOPMENT_TEAM = BACF8TNGJ6;
356 | ENABLE_PREVIEWS = YES;
357 | GENERATE_INFOPLIST_FILE = YES;
358 | INFOPLIST_KEY_CFBundleDisplayName = Quizzo;
359 | INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.education";
360 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
361 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
362 | INFOPLIST_KEY_UILaunchScreen_Generation = YES;
363 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
364 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
365 | LD_RUNPATH_SEARCH_PATHS = (
366 | "$(inherited)",
367 | "@executable_path/Frameworks",
368 | );
369 | MARKETING_VERSION = 1.0;
370 | PRODUCT_BUNDLE_IDENTIFIER = com.aritra.Quizzo;
371 | PRODUCT_NAME = "$(TARGET_NAME)";
372 | SWIFT_EMIT_LOC_STRINGS = YES;
373 | SWIFT_VERSION = 5.0;
374 | TARGETED_DEVICE_FAMILY = "1,2";
375 | };
376 | name = Debug;
377 | };
378 | 9AA2609A2BC2D52E004F5223 /* Release */ = {
379 | isa = XCBuildConfiguration;
380 | buildSettings = {
381 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
382 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
383 | CODE_SIGN_STYLE = Automatic;
384 | CURRENT_PROJECT_VERSION = 1;
385 | DEVELOPMENT_ASSET_PATHS = "\"Quizzo/Preview Content\"";
386 | DEVELOPMENT_TEAM = BACF8TNGJ6;
387 | ENABLE_PREVIEWS = YES;
388 | GENERATE_INFOPLIST_FILE = YES;
389 | INFOPLIST_KEY_CFBundleDisplayName = Quizzo;
390 | INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.education";
391 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
392 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
393 | INFOPLIST_KEY_UILaunchScreen_Generation = YES;
394 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
395 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
396 | LD_RUNPATH_SEARCH_PATHS = (
397 | "$(inherited)",
398 | "@executable_path/Frameworks",
399 | );
400 | MARKETING_VERSION = 1.0;
401 | PRODUCT_BUNDLE_IDENTIFIER = com.aritra.Quizzo;
402 | PRODUCT_NAME = "$(TARGET_NAME)";
403 | SWIFT_EMIT_LOC_STRINGS = YES;
404 | SWIFT_VERSION = 5.0;
405 | TARGETED_DEVICE_FAMILY = "1,2";
406 | };
407 | name = Release;
408 | };
409 | /* End XCBuildConfiguration section */
410 |
411 | /* Begin XCConfigurationList section */
412 | 9AA260852BC2D52D004F5223 /* Build configuration list for PBXProject "Quizzo" */ = {
413 | isa = XCConfigurationList;
414 | buildConfigurations = (
415 | 9AA260962BC2D52E004F5223 /* Debug */,
416 | 9AA260972BC2D52E004F5223 /* Release */,
417 | );
418 | defaultConfigurationIsVisible = 0;
419 | defaultConfigurationName = Release;
420 | };
421 | 9AA260982BC2D52E004F5223 /* Build configuration list for PBXNativeTarget "Quizzo" */ = {
422 | isa = XCConfigurationList;
423 | buildConfigurations = (
424 | 9AA260992BC2D52E004F5223 /* Debug */,
425 | 9AA2609A2BC2D52E004F5223 /* Release */,
426 | );
427 | defaultConfigurationIsVisible = 0;
428 | defaultConfigurationName = Release;
429 | };
430 | /* End XCConfigurationList section */
431 | };
432 | rootObject = 9AA260822BC2D52D004F5223 /* Project object */;
433 | }
434 |
--------------------------------------------------------------------------------