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 06 #754

Open
wants to merge 19 commits into
base: project_sprint_3_start
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d00a4f1
В AppDelegate добавлен вывод на консоль для тестирования коммита чере…
SergeyGoesWild Sep 18, 2023
4a6835e
В AppDelegate изменен print
SergeyGoesWild Sep 18, 2023
182cc0a
Merge pull request #1 from SergeyGoesWild/testBranch
SergeyGoesWild Sep 18, 2023
48090b9
Подготовлена конечная версия приложения, устранены баги со спамом кно…
SergeyGoesWild Sep 18, 2023
f5e82ba
Подготовлена финальная версия приложения (по состоянию на 4ый спринт).
SergeyGoesWild Oct 11, 2023
9cc60f7
Подготовлена финальная версия приложения (по состоянию на 4ый спринт).
SergeyGoesWild Oct 11, 2023
47e3c4b
Ненужный коммит, я просто пытаюсь разобраться как это работает
SergeyGoesWild Oct 11, 2023
0b35a9e
Удалил один пробел, чтобы посмотреть, привносятся изменения или нет
SergeyGoesWild Oct 11, 2023
c63c432
Merge branch 'sprint_04' of github.com:SergeyGoesWild/MovieQuiz-ios i…
SergeyGoesWild Oct 12, 2023
67e1e6b
Добавлены исправления после код ревью, в частности скругление изображ…
SergeyGoesWild Oct 13, 2023
71fd8d9
Закончил теорию, начинаю практическое задание
SergeyGoesWild Oct 24, 2023
e2e2361
Добавил сообщение между классами и делегата
SergeyGoesWild Oct 26, 2023
c0a9536
Добавил структуру Alert model.
SergeyGoesWild Oct 26, 2023
a3d8492
AlertPresenter теперь не бесполезный проходной класс, поместил туда a…
SergeyGoesWild Oct 26, 2023
f286f75
Закончена работа с staticService, сдаю проект.
SergeyGoesWild Nov 13, 2023
f9afa80
1ая волна исправлений после код ревью
SergeyGoesWild Nov 14, 2023
7fdd0bc
Merge pull request #3 from SergeyGoesWild/sprint_05
SergeyGoesWild Jul 9, 2024
bb2c905
Шестой спринт работает
SergeyGoesWild Jul 11, 2024
1f32596
Изменил поведение индикатора, теперь его видно когда подгружается изо…
SergeyGoesWild Jul 14, 2024
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
92 changes: 92 additions & 0 deletions MovieQuiz.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@
objects = {

/* Begin PBXBuildFile section */
2A1C8BA02ACD98F300CC0077 /* YS Display-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2A1C8B9E2ACD98F300CC0077 /* YS Display-Bold.ttf */; };
2A1C8BA12ACD98F300CC0077 /* YS Display-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2A1C8B9F2ACD98F300CC0077 /* YS Display-Medium.ttf */; };
2A35041A2AF2FE190088FB50 /* Movie.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A3504192AF2FE190088FB50 /* Movie.swift */; };
2AA0828F2C3DF54A00D365D6 /* NetworkClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AA0828E2C3DF54A00D365D6 /* NetworkClient.swift */; };
2AA082912C3DF9FA00D365D6 /* MostPopularMovies.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AA082902C3DF9FA00D365D6 /* MostPopularMovies.swift */; };
2AA082932C3DFBF100D365D6 /* MoviesLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AA082922C3DFBF100D365D6 /* MoviesLoader.swift */; };
2AC7A89A2AF803E300A08178 /* StatisticService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC7A8992AF803E300A08178 /* StatisticService.swift */; };
2AC7A89C2AF807AB00A08178 /* StatisticServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC7A89B2AF807AB00A08178 /* StatisticServiceProtocol.swift */; };
2ADA29BF2AE26A9200C7010E /* QuestionFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2ADA29BE2AE26A9200C7010E /* QuestionFactory.swift */; };
2ADA29C22AE27D5100C7010E /* QuizQuestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2ADA29C12AE27D5100C7010E /* QuizQuestion.swift */; };
2ADA29C42AE27D6600C7010E /* QuizStepViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2ADA29C32AE27D6600C7010E /* QuizStepViewModel.swift */; };
2ADA29C62AE2B8BA00C7010E /* QuestionFactoryProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2ADA29C52AE2B8BA00C7010E /* QuestionFactoryProtocol.swift */; };
2AFA38BC2AE55D1D007E5EBB /* QuestionFactoryDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFA38BB2AE55D1D007E5EBB /* QuestionFactoryDelegate.swift */; };
2AFB86552AE9282B0023AB32 /* AlertPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFB86542AE9282B0023AB32 /* AlertPresenter.swift */; };
2AFB86572AE92B850023AB32 /* AlertPresenterDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFB86562AE92B850023AB32 /* AlertPresenterDelegate.swift */; };
2AFB86592AE931660023AB32 /* AlertPresenterProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFB86582AE931660023AB32 /* AlertPresenterProtocol.swift */; };
2AFB865B2AEA66570023AB32 /* AlertModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFB865A2AEA66570023AB32 /* AlertModel.swift */; };
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 +36,23 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
2A1C8B9E2ACD98F300CC0077 /* YS Display-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "YS Display-Bold.ttf"; sourceTree = "<group>"; };
2A1C8B9F2ACD98F300CC0077 /* YS Display-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "YS Display-Medium.ttf"; sourceTree = "<group>"; };
2A3504192AF2FE190088FB50 /* Movie.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Movie.swift; sourceTree = "<group>"; };
2AA0828E2C3DF54A00D365D6 /* NetworkClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkClient.swift; sourceTree = "<group>"; };
2AA082902C3DF9FA00D365D6 /* MostPopularMovies.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MostPopularMovies.swift; sourceTree = "<group>"; };
2AA082922C3DFBF100D365D6 /* MoviesLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoviesLoader.swift; sourceTree = "<group>"; };
2AC7A8992AF803E300A08178 /* StatisticService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatisticService.swift; sourceTree = "<group>"; };
2AC7A89B2AF807AB00A08178 /* StatisticServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatisticServiceProtocol.swift; sourceTree = "<group>"; };
2ADA29BE2AE26A9200C7010E /* QuestionFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionFactory.swift; sourceTree = "<group>"; };
2ADA29C12AE27D5100C7010E /* QuizQuestion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuizQuestion.swift; sourceTree = "<group>"; };
2ADA29C32AE27D6600C7010E /* QuizStepViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuizStepViewModel.swift; sourceTree = "<group>"; };
2ADA29C52AE2B8BA00C7010E /* QuestionFactoryProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionFactoryProtocol.swift; sourceTree = "<group>"; };
2AFA38BB2AE55D1D007E5EBB /* QuestionFactoryDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionFactoryDelegate.swift; sourceTree = "<group>"; };
2AFB86542AE9282B0023AB32 /* AlertPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertPresenter.swift; sourceTree = "<group>"; };
2AFB86562AE92B850023AB32 /* AlertPresenterDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertPresenterDelegate.swift; sourceTree = "<group>"; };
2AFB86582AE931660023AB32 /* AlertPresenterProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertPresenterProtocol.swift; sourceTree = "<group>"; };
2AFB865A2AEA66570023AB32 /* AlertModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertModel.swift; 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,6 +77,44 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
2A1C8B9D2ACD98F300CC0077 /* Fonts */ = {
isa = PBXGroup;
children = (
2A1C8B9E2ACD98F300CC0077 /* YS Display-Bold.ttf */,
2A1C8B9F2ACD98F300CC0077 /* YS Display-Medium.ttf */,
);
path = Fonts;
sourceTree = "<group>";
};
2ADA29BD2AE26A5B00C7010E /* Services */ = {
isa = PBXGroup;
children = (
2ADA29BE2AE26A9200C7010E /* QuestionFactory.swift */,
2ADA29C52AE2B8BA00C7010E /* QuestionFactoryProtocol.swift */,
2AFA38BB2AE55D1D007E5EBB /* QuestionFactoryDelegate.swift */,
2AFB86542AE9282B0023AB32 /* AlertPresenter.swift */,
2AFB86562AE92B850023AB32 /* AlertPresenterDelegate.swift */,
2AFB86582AE931660023AB32 /* AlertPresenterProtocol.swift */,
2AC7A8992AF803E300A08178 /* StatisticService.swift */,
2AC7A89B2AF807AB00A08178 /* StatisticServiceProtocol.swift */,
2AA0828E2C3DF54A00D365D6 /* NetworkClient.swift */,
2AA082922C3DFBF100D365D6 /* MoviesLoader.swift */,
);
path = Services;
sourceTree = "<group>";
};
2ADA29C02AE27D3400C7010E /* Models */ = {
isa = PBXGroup;
children = (
2ADA29C12AE27D5100C7010E /* QuizQuestion.swift */,
2ADA29C32AE27D6600C7010E /* QuizStepViewModel.swift */,
2AFB865A2AEA66570023AB32 /* AlertModel.swift */,
2A3504192AF2FE190088FB50 /* Movie.swift */,
2AA082902C3DF9FA00D365D6 /* MostPopularMovies.swift */,
);
path = Models;
sourceTree = "<group>";
};
8F4738322848DE2A005DF65E /* Presentation */ = {
isa = PBXGroup;
children = (
Expand All @@ -55,6 +127,7 @@
8F4738332848DE46005DF65E /* Resources */ = {
isa = PBXGroup;
children = (
2A1C8B9D2ACD98F300CC0077 /* Fonts */,
AD1ABABC2831907F00B3E448 /* LaunchScreen.storyboard */,
AD1ABABA2831907F00B3E448 /* Assets.xcassets */,
AD1ABABF2831907F00B3E448 /* Info.plist */,
Expand All @@ -81,6 +154,8 @@
AD1ABAB02831907B00B3E448 /* MovieQuiz */ = {
isa = PBXGroup;
children = (
2ADA29C02AE27D3400C7010E /* Models */,
2ADA29BD2AE26A5B00C7010E /* Services */,
8F4738322848DE2A005DF65E /* Presentation */,
ADF0CF75283FDAA10075F54D /* Helpers */,
8F4738332848DE46005DF65E /* Resources */,
Expand Down Expand Up @@ -162,6 +237,8 @@
AD1ABABE2831907F00B3E448 /* LaunchScreen.storyboard in Resources */,
AD1ABABB2831907F00B3E448 /* Assets.xcassets in Resources */,
AD1ABAB92831907B00B3E448 /* Main.storyboard in Resources */,
2A1C8BA02ACD98F300CC0077 /* YS Display-Bold.ttf in Resources */,
2A1C8BA12ACD98F300CC0077 /* YS Display-Medium.ttf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -172,12 +249,27 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2AA0828F2C3DF54A00D365D6 /* NetworkClient.swift in Sources */,
2AC7A89C2AF807AB00A08178 /* StatisticServiceProtocol.swift in Sources */,
AD5EE5DE284D7887003966EF /* UIColor+Extensions.swift in Sources */,
2AA082912C3DF9FA00D365D6 /* MostPopularMovies.swift in Sources */,
AD7AFA552836189F00399704 /* Array+Extensions.swift in Sources */,
2ADA29C42AE27D6600C7010E /* QuizStepViewModel.swift in Sources */,
2AFB86572AE92B850023AB32 /* AlertPresenterDelegate.swift in Sources */,
AD1ABAB62831907B00B3E448 /* MovieQuizViewController.swift in Sources */,
2AFB86592AE931660023AB32 /* AlertPresenterProtocol.swift in Sources */,
2A35041A2AF2FE190088FB50 /* Movie.swift in Sources */,
2AFA38BC2AE55D1D007E5EBB /* QuestionFactoryDelegate.swift in Sources */,
2ADA29BF2AE26A9200C7010E /* QuestionFactory.swift in Sources */,
AD77F5742857F8810062FB14 /* Date+Extensions.swift in Sources */,
AD1ABAB22831907B00B3E448 /* AppDelegate.swift in Sources */,
2ADA29C22AE27D5100C7010E /* QuizQuestion.swift in Sources */,
2ADA29C62AE2B8BA00C7010E /* QuestionFactoryProtocol.swift in Sources */,
AD1ABAB42831907B00B3E448 /* SceneDelegate.swift in Sources */,
2AFB865B2AEA66570023AB32 /* AlertModel.swift in Sources */,
2AFB86552AE9282B0023AB32 /* AlertPresenter.swift in Sources */,
2AC7A89A2AF803E300A08178 /* StatisticService.swift in Sources */,
2AA082932C3DFBF100D365D6 /* MoviesLoader.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
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 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 Sergey Telnov on 26/10/2023.
//

import Foundation

struct AlertModel {
let title: String
let message: String
let buttonText: String
let buttonAction: () -> Void
}
35 changes: 35 additions & 0 deletions MovieQuiz/Models/MostPopularMovies.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// MostPopularMovies.swift
// MovieQuiz
//
// Created by Sergey Telnov on 10/07/2024.
//

import Foundation

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

struct MostPopularMovie: Codable {
var title: String
var rating: String
var 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"
}
}
51 changes: 51 additions & 0 deletions MovieQuiz/Models/Movie.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// Movie.swift
// MovieQuiz
//
// Created by Sergey Telnov on 01/11/2023.
//

import Foundation

struct Actor : Codable {
let id: String
let image: String
let name: String
let asCharacter: String
}

struct Movie : Codable {
let id: String
let title: String
let year: Int
let image: String
let releaseDate: String
let runtimeMins: Int
let directors: String
let actorList: [Actor]

enum CodingKeys: CodingKey {
case id, title, year, image, releaseDate, runtimeMins, directors, actorList
}

enum ParseError: Error {
case yearFailure
case runtimeFailure
}

init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decode(String.self, forKey: .id)
title = try container.decode(String.self, forKey: .title)
image = try container.decode(String.self, forKey: .image)
releaseDate = try container.decode(String.self, forKey: .releaseDate)
directors = try container.decode(String.self, forKey: .directors)
actorList = try container.decode([Actor].self, forKey: .actorList)
let year = try container.decode(String.self, forKey: .year)
guard let yearValue = Int(year) else { throw ParseError.yearFailure }
self.year = yearValue
let runtimeMins = try container.decode(String.self, forKey: .runtimeMins)
guard let runtimeValue = Int(runtimeMins) else { throw ParseError.runtimeFailure }
self.runtimeMins = runtimeValue
}
}
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 Sergey Telnov on 20/10/2023.
//

import Foundation

struct QuizQuestion {
let image: Data
let text: String
let answer: Bool
}
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 Sergey Telnov on 20/10/2023.
//

import UIKit

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