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 7 #742

Open
wants to merge 12 commits into
base: project_sprint_3_start
Choose a base branch
from
Empty file added .zprofile
Empty file.
410 changes: 400 additions & 10 deletions MovieQuiz.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions MovieQuiz.xcodeproj/xcshareddata/xcschemes/MovieQuiz.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<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">
<TestPlans>
<TestPlanReference
reference = "container:MovieQuiz.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
</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>
36 changes: 36 additions & 0 deletions MovieQuiz.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"configurations" : [
{
"id" : "0AFFD9BE-0A08-494D-81AF-91D3473A6598",
"name" : "Test Scheme Action",
"options" : {

}
}
],
"defaultOptions" : {
"codeCoverage" : false,
"targetForVariableExpansion" : {
"containerPath" : "container:MovieQuiz.xcodeproj",
"identifier" : "AD1ABAAD2831907B00B3E448",
"name" : "MovieQuiz"
}
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:MovieQuiz.xcodeproj",
"identifier" : "332915C02BC57FA700E8DCBF",
"name" : "MovieQuizTests"
}
},
{
"target" : {
"containerPath" : "container:MovieQuiz.xcodeproj",
"identifier" : "33248B742BD446C2004DD6A6",
"name" : "MovieQuizUITests"
}
}
],
"version" : 1
}
13 changes: 10 additions & 3 deletions MovieQuiz/Helpers/UIColor+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import UIKit

extension UIColor { }
//import UIKit
//
//extension UIColor {
// static var ypGreen: UIColor { UIColor(named: "YP Green") ?? UIColor.green }
// static var ypRed: UIColor { UIColor(named: "YP Red") ?? UIColor.red }
// static var ypBlack: UIColor { UIColor(named: "YP Black") ?? UIColor.black}
// static var ypBackground: UIColor { UIColor(named: "YP Background") ?? UIColor.darkGray }
// static var ypGray: UIColor { UIColor(named: "YP Gray") ?? UIColor.gray }
// static var ypWhite: UIColor { UIColor(named: "YP White") ?? UIColor.white}
//}
15 changes: 15 additions & 0 deletions MovieQuiz/Models/AlertModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// AlertModel.swift
// MovieQuiz
//
// Created by Александр Верповский on 09.02.2024.
//

import UIKit

struct AlertModel {
let title: String
let message: String
let buttonText: String
var completion: ((UIAlertAction) -> Void)?
}
20 changes: 20 additions & 0 deletions MovieQuiz/Models/GameRecord.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// GameRecord.swift
// MovieQuiz
//
// Created by Александр Верповский on 16.02.2024.
//

import Foundation

struct GameRecord: Codable {
let correct: Int
let total: Int
let date: Date
}

extension GameRecord: Comparable {
static func < (lhs: GameRecord, rhs: GameRecord) -> Bool {
return lhs.correct < rhs.correct
}
}
36 changes: 36 additions & 0 deletions MovieQuiz/Models/MostPopularMovies.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// MostPopularMovies.swift
// MovieQuiz
//
// Created by Александр Верповский on 25.02.2024.
//

import Foundation

struct MostPopularMovies: Codable {
let errorMessage: String
let items: [MostPopularMovie]
}

struct MostPopularMovie: Codable {
let title: String
let rating: String?
let imageURL: URL

var resizedImageURL: URL {
let urlString = imageURL.absoluteString
let imageUrlString = urlString.components(separatedBy: "._")[0] + "._V0_UX600_.jpg"

guard let newURL = URL(string: imageUrlString) else {
return imageURL
}

return newURL
}

private enum CodingKeys: String, CodingKey {
case title = "fullTitle"
case rating = "imDbRating"
case imageURL = "image"
}
}
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 Александр Верповский on 08.02.2024.
//

import Foundation

struct QuizQuestion {
let image: Data
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 Александр Верповский on 08.02.2024.
//

import Foundation

struct QuizResultsViewModel {
let title: String
let text: String
let buttonText: String
}
14 changes: 14 additions & 0 deletions MovieQuiz/Models/QuizStepViewModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// QuizStepViewModel.swift
// MovieQuiz
//
// Created by Александр Верповский on 08.02.2024.
//

import UIKit

struct QuizStepViewModel {
let image: UIImage
let question: String
let questionNumber: String
}
Loading