Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprint 05.1 #739

Open
wants to merge 21 commits into
base: project_sprint_3_start
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 86 additions & 2 deletions MovieQuiz.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
objects = {

/* Begin PBXBuildFile section */
05CCCCE02B7AA59B00919779 /* QuizStepViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05CCCCDF2B7AA59B00919779 /* QuizStepViewModel.swift */; };
05CCCCE22B7AA5AB00919779 /* QuizResultsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05CCCCE12B7AA5AB00919779 /* QuizResultsViewModel.swift */; };
05CCCCE42B7AA5B900919779 /* QuizQuestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05CCCCE32B7AA5B900919779 /* QuizQuestion.swift */; };
05CCCCE62B7AA6F400919779 /* QuestionFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05CCCCE52B7AA6F400919779 /* QuestionFactory.swift */; };
05CCCCE82B7AA70300919779 /* QuestionFactoryProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05CCCCE72B7AA70300919779 /* QuestionFactoryProtocol.swift */; };
05CCCCEA2B7AA71300919779 /* QuestionFacotryDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05CCCCE92B7AA71300919779 /* QuestionFacotryDelegate.swift */; };
05CCCCEC2B7AA72500919779 /* AlertProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05CCCCEB2B7AA72500919779 /* AlertProtocol.swift */; };
05CCCCEE2B7AA73700919779 /* StatisticService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05CCCCED2B7AA73700919779 /* StatisticService.swift */; };
05CCCCF02B7AA74B00919779 /* AlertPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05CCCCEF2B7AA74B00919779 /* AlertPresenter.swift */; };
05CCCCF22B7AA75B00919779 /* AlertModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05CCCCF12B7AA75B00919779 /* AlertModel.swift */; };
05CCCCF42B7AA76C00919779 /* GameRecord.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05CCCCF32B7AA76C00919779 /* GameRecord.swift */; };
05D765B12AED501400B36D84 /* YS Display-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 05D765AF2AED501400B36D84 /* YS Display-Bold.ttf */; };
05D765B22AED501400B36D84 /* YS Display-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 05D765B02AED501400B36D84 /* YS Display-Medium.ttf */; };
AD1ABAB22831907B00B3E448 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD1ABAB12831907B00B3E448 /* AppDelegate.swift */; };
AD1ABAB42831907B00B3E448 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD1ABAB32831907B00B3E448 /* SceneDelegate.swift */; };
AD1ABAB62831907B00B3E448 /* MovieQuizViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD1ABAB52831907B00B3E448 /* MovieQuizViewController.swift */; };
Expand All @@ -19,6 +32,19 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
05CCCCDF2B7AA59B00919779 /* QuizStepViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuizStepViewModel.swift; sourceTree = "<group>"; };
05CCCCE12B7AA5AB00919779 /* QuizResultsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuizResultsViewModel.swift; sourceTree = "<group>"; };
05CCCCE32B7AA5B900919779 /* QuizQuestion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuizQuestion.swift; sourceTree = "<group>"; };
05CCCCE52B7AA6F400919779 /* QuestionFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionFactory.swift; sourceTree = "<group>"; };
05CCCCE72B7AA70300919779 /* QuestionFactoryProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionFactoryProtocol.swift; sourceTree = "<group>"; };
05CCCCE92B7AA71300919779 /* QuestionFacotryDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionFacotryDelegate.swift; sourceTree = "<group>"; };
05CCCCEB2B7AA72500919779 /* AlertProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertProtocol.swift; sourceTree = "<group>"; };
05CCCCED2B7AA73700919779 /* StatisticService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatisticService.swift; sourceTree = "<group>"; };
05CCCCEF2B7AA74B00919779 /* AlertPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertPresenter.swift; sourceTree = "<group>"; };
05CCCCF12B7AA75B00919779 /* AlertModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertModel.swift; sourceTree = "<group>"; };
05CCCCF32B7AA76C00919779 /* GameRecord.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameRecord.swift; sourceTree = "<group>"; };
05D765AF2AED501400B36D84 /* YS Display-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "YS Display-Bold.ttf"; sourceTree = "<group>"; };
05D765B02AED501400B36D84 /* YS Display-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "YS Display-Medium.ttf"; sourceTree = "<group>"; };
AD1ABAAE2831907B00B3E448 /* MovieQuiz.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MovieQuiz.app; sourceTree = BUILT_PRODUCTS_DIR; };
AD1ABAB12831907B00B3E448 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
AD1ABAB32831907B00B3E448 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand All @@ -43,18 +69,61 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
05AB46F32AED53960047E51B /* Fonts */ = {
isa = PBXGroup;
children = (
05D765B32AED502000B36D84 /* YS Display */,
);
path = Fonts;
sourceTree = "<group>";
};
05CCCCDD2B7AA42900919779 /* Modelss */ = {
isa = PBXGroup;
children = (
05CCCCDF2B7AA59B00919779 /* QuizStepViewModel.swift */,
05CCCCE12B7AA5AB00919779 /* QuizResultsViewModel.swift */,
05CCCCE32B7AA5B900919779 /* QuizQuestion.swift */,
05CCCCF12B7AA75B00919779 /* AlertModel.swift */,
05CCCCF32B7AA76C00919779 /* GameRecord.swift */,
);
path = Modelss;
sourceTree = "<group>";
};
05CCCCDE2B7AA4CA00919779 /* Servicess */ = {
isa = PBXGroup;
children = (
05CCCCE52B7AA6F400919779 /* QuestionFactory.swift */,
05CCCCE72B7AA70300919779 /* QuestionFactoryProtocol.swift */,
05CCCCE92B7AA71300919779 /* QuestionFacotryDelegate.swift */,
05CCCCEB2B7AA72500919779 /* AlertProtocol.swift */,
05CCCCED2B7AA73700919779 /* StatisticService.swift */,
);
path = Servicess;
sourceTree = "<group>";
};
05D765B32AED502000B36D84 /* YS Display */ = {
isa = PBXGroup;
children = (
05D765AF2AED501400B36D84 /* YS Display-Bold.ttf */,
05D765B02AED501400B36D84 /* YS Display-Medium.ttf */,
);
path = "YS Display";
sourceTree = "<group>";
};
8F4738322848DE2A005DF65E /* Presentation */ = {
isa = PBXGroup;
children = (
AD1ABAB52831907B00B3E448 /* MovieQuizViewController.swift */,
AD1ABAB72831907B00B3E448 /* Main.storyboard */,
05CCCCEF2B7AA74B00919779 /* AlertPresenter.swift */,
);
path = Presentation;
sourceTree = "<group>";
};
8F4738332848DE46005DF65E /* Resources */ = {
isa = PBXGroup;
children = (
05AB46F32AED53960047E51B /* Fonts */,
AD1ABABC2831907F00B3E448 /* LaunchScreen.storyboard */,
AD1ABABA2831907F00B3E448 /* Assets.xcassets */,
AD1ABABF2831907F00B3E448 /* Info.plist */,
Expand All @@ -81,6 +150,8 @@
AD1ABAB02831907B00B3E448 /* MovieQuiz */ = {
isa = PBXGroup;
children = (
05CCCCDD2B7AA42900919779 /* Modelss */,
05CCCCDE2B7AA4CA00919779 /* Servicess */,
8F4738322848DE2A005DF65E /* Presentation */,
ADF0CF75283FDAA10075F54D /* Helpers */,
8F4738332848DE46005DF65E /* Resources */,
Expand Down Expand Up @@ -162,6 +233,8 @@
AD1ABABE2831907F00B3E448 /* LaunchScreen.storyboard in Resources */,
AD1ABABB2831907F00B3E448 /* Assets.xcassets in Resources */,
AD1ABAB92831907B00B3E448 /* Main.storyboard in Resources */,
05D765B12AED501400B36D84 /* YS Display-Bold.ttf in Resources */,
05D765B22AED501400B36D84 /* YS Display-Medium.ttf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -172,12 +245,23 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
05CCCCE42B7AA5B900919779 /* QuizQuestion.swift in Sources */,
05CCCCEC2B7AA72500919779 /* AlertProtocol.swift in Sources */,
AD5EE5DE284D7887003966EF /* UIColor+Extensions.swift in Sources */,
05CCCCE82B7AA70300919779 /* QuestionFactoryProtocol.swift in Sources */,
05CCCCF22B7AA75B00919779 /* AlertModel.swift in Sources */,
05CCCCEA2B7AA71300919779 /* QuestionFacotryDelegate.swift in Sources */,
05CCCCF02B7AA74B00919779 /* AlertPresenter.swift in Sources */,
AD7AFA552836189F00399704 /* Array+Extensions.swift in Sources */,
AD1ABAB62831907B00B3E448 /* MovieQuizViewController.swift in Sources */,
AD77F5742857F8810062FB14 /* Date+Extensions.swift in Sources */,
05CCCCEE2B7AA73700919779 /* StatisticService.swift in Sources */,
05CCCCF42B7AA76C00919779 /* GameRecord.swift in Sources */,
05CCCCE22B7AA5AB00919779 /* QuizResultsViewModel.swift in Sources */,
AD1ABAB22831907B00B3E448 /* AppDelegate.swift in Sources */,
AD1ABAB42831907B00B3E448 /* SceneDelegate.swift in Sources */,
05CCCCE62B7AA6F400919779 /* QuestionFactory.swift in Sources */,
05CCCCE02B7AA59B00919779 /* QuizStepViewModel.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -323,7 +407,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = N29P9VDV4Y;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MovieQuiz/Resources/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand Down Expand Up @@ -353,7 +437,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = N29P9VDV4Y;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MovieQuiz/Resources/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand Down
77 changes: 77 additions & 0 deletions MovieQuiz.xcodeproj/xcshareddata/xcschemes/MovieQuiz.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AD1ABAAD2831907B00B3E448"
BuildableName = "MovieQuiz.app"
BlueprintName = "MovieQuiz"
ReferencedContainer = "container:MovieQuiz.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AD1ABAAD2831907B00B3E448"
BuildableName = "MovieQuiz.app"
BlueprintName = "MovieQuiz"
ReferencedContainer = "container:MovieQuiz.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AD1ABAAD2831907B00B3E448"
BuildableName = "MovieQuiz.app"
BlueprintName = "MovieQuiz"
ReferencedContainer = "container:MovieQuiz.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion MovieQuiz/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
) -> Bool {
return true
}

// MARK: UISceneSession Lifecycle

func application(
Expand Down
9 changes: 8 additions & 1 deletion MovieQuiz/Helpers/UIColor+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import UIKit

extension UIColor { }
extension UIColor {
static var ysBlack: UIColor { UIColor(named: "YS Black") ?? UIColor.black }
static var ysWhite: UIColor { UIColor(named: "YS White") ?? UIColor.white }
static var ysGray: UIColor { UIColor(named: "YS Gray") ?? UIColor.gray }
static var ysGreen: UIColor { UIColor(named: "YS Green") ?? UIColor.green }
static var ysRed: UIColor { UIColor(named: "YS Red") ?? UIColor.red }
static var ysBackground: UIColor { UIColor(named: "YS Background") ?? UIColor.darkGray }
}
8 changes: 8 additions & 0 deletions MovieQuiz/Models/AlertModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// AlertModel.swift
// MovieQuiz
//
// Created by Vanya Pavlov on 27.01.2024.
//

import Foundation
8 changes: 8 additions & 0 deletions MovieQuiz/Models/BestGame.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// BestGame.swift
// MovieQuiz
//
// Created by Vanya Pavlov on 07.02.2024.
//

import Foundation
8 changes: 8 additions & 0 deletions MovieQuiz/Models/GameRecord.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// GameRecord.swift
// MovieQuiz
//
// Created by Vanya Pavlov on 08.02.2024.
//

import Foundation
8 changes: 8 additions & 0 deletions MovieQuiz/Models/Movie.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// Movie.swift
// MovieQuiz
//
// Created by Vanya Pavlov on 06.02.2024.
//

import Foundation
14 changes: 14 additions & 0 deletions MovieQuiz/Models/QuizQuestion.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// QuizQuestion.swift
// MovieQuiz
//
// Created by Vanya Pavlov on 21.11.2023.
//

import Foundation

private struct QuizQuestion {
let image: String
let text: String
let correctAnswer: Bool
}
14 changes: 14 additions & 0 deletions MovieQuiz/Models/QuizResultsViewModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// QuizResultsViewModel.swift
// MovieQuiz
//
// Created by Vanya Pavlov on 21.11.2023.
//

import Foundation

private struct QuizResultsViewModel {
let title: String
let text: String
let buttonText: String
}
15 changes: 15 additions & 0 deletions MovieQuiz/Models/QuizStepViewModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// QuizStepViewModel.swift
// MovieQuiz
//
// Created by Vanya Pavlov on 21.11.2023.
//

import Foundation
import UIKit

private struct QuizStepViewModel {
let image: UIImage
let question: String
let questionNumber: String
}
8 changes: 8 additions & 0 deletions MovieQuiz/Modelss/AlertModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Foundation

struct AlertModel {
let title: String
let message: String
let buttonTexts: String
let completions: () -> Void
}
29 changes: 29 additions & 0 deletions MovieQuiz/Modelss/GameRecord.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import Foundation

struct GameRecord: Codable {

private enum Keys: CodingKey {
case correct, total, date
}

let correct: Int
let total: Int
let date: Date

init(from decoder: any Decoder) throws {
let container = try decoder.container(keyedBy: Keys.self)
self.correct = try container.decode(Int.self, forKey: .correct)
self.total = try container.decode(Int.self, forKey: .total)
self.date = try container.decode(Date.self, forKey: .date)
}

init(correct: Int, total: Int, date: Date) {
self.correct = correct
self.total = total
self.date = date
}

func isBetterThan(_ another: GameRecord) -> Bool {
correct < another.correct
}
}
7 changes: 7 additions & 0 deletions MovieQuiz/Modelss/QuizQuestion.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Foundation

public struct QuizQuestion {
let image: String
let text: String
let correctAnswer: Bool
}
8 changes: 8 additions & 0 deletions MovieQuiz/Modelss/QuizResultsViewModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Foundation

public struct QuizResultsViewModel {
let title: String
let text: String
let buttonText: String
}

Loading