Skip to content

Commit

Permalink
Merge pull request #15 from f-lab-edu/feat/#7-genreView
Browse files Browse the repository at this point in the history
[#7] 선택 화면(장르 선택) 구현
  • Loading branch information
NORIKIM authored Feb 10, 2025
2 parents 47ac45b + 7c9ebcb commit a510735
Show file tree
Hide file tree
Showing 23 changed files with 860 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

## User settings
xcuserdata/
Secret.plist

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
Expand Down
114 changes: 114 additions & 0 deletions TodayVideo/TodayVideo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
objects = {

/* Begin PBXBuildFile section */
254D7B3D2D3CD64E00754A38 /* Genre.swift in Sources */ = {isa = PBXBuildFile; fileRef = 254D7B3C2D3CD64E00754A38 /* Genre.swift */; };
254D7B402D3CD9B000754A38 /* GenreInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 254D7B3F2D3CD9B000754A38 /* GenreInteractor.swift */; };
254D7B432D46977E00754A38 /* Network.swift in Sources */ = {isa = PBXBuildFile; fileRef = 254D7B422D46977E00754A38 /* Network.swift */; };
254D7B452D46B47000754A38 /* GenreView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 254D7B442D46B47000754A38 /* GenreView.swift */; };
254D7B472D46B48A00754A38 /* GenrePresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 254D7B462D46B48A00754A38 /* GenrePresenter.swift */; };
254D7B492D46B49900754A38 /* GenreRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 254D7B482D46B49900754A38 /* GenreRouter.swift */; };
254D7B4F2D4784D900754A38 /* UserdefaultKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 254D7B4E2D4784D900754A38 /* UserdefaultKey.swift */; };
254D7B512D47A9C000754A38 /* PreviousButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 254D7B502D47A9C000754A38 /* PreviousButton.swift */; };
254D7B572D4F9A4400754A38 /* Bundle+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 254D7B562D4F9A4400754A38 /* Bundle+Extensions.swift */; };
254D7B5B2D58CF0C00754A38 /* Secret.plist in Resources */ = {isa = PBXBuildFile; fileRef = 254D7B5A2D58CF0C00754A38 /* Secret.plist */; };
3C6E5A33D507ABB76B8E24C4 /* Pods_TodayVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BCFF433EB8A6D8B17F3CEB3 /* Pods_TodayVideo.framework */; };
47B663CC8D8E3B9C6597D6A8 /* Pods_TodayVideo_TodayVideoUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FFB8528AC96E0E4545364CA7 /* Pods_TodayVideo_TodayVideoUITests.framework */; };
642F696B881908AADE34D680 /* Pods_TodayVideoTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A000755573841D92675025D /* Pods_TodayVideoTests.framework */; };
Expand All @@ -29,6 +39,12 @@
CE9EAC3B2D2239E300971DB4 /* TodayVideoUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE9EAC3A2D2239E300971DB4 /* TodayVideoUITestsLaunchTests.swift */; };
CE9EAC492D223B2300971DB4 /* SplashPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE9EAC482D223B2300971DB4 /* SplashPresenter.swift */; };
CE9EAC4B2D223B2D00971DB4 /* SplashRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE9EAC4A2D223B2D00971DB4 /* SplashRouter.swift */; };
CEDBD8862D509D290086F6A3 /* Endpoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEDBD8852D509D290086F6A3 /* Endpoint.swift */; };
CEDBD8882D509DE80086F6A3 /* APIEndpoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEDBD8872D509DE80086F6A3 /* APIEndpoint.swift */; };
CEDBD88B2D50A91E0086F6A3 /* Requestable.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEDBD88A2D50A91E0086F6A3 /* Requestable.swift */; };
CEDBD88D2D50A9500086F6A3 /* Responsable.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEDBD88C2D50A9500086F6A3 /* Responsable.swift */; };
CEDBD88F2D50A9E00086F6A3 /* Encodable+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEDBD88E2D50A9E00086F6A3 /* Encodable+Extensions.swift */; };
CEDBD8912D50ABB10086F6A3 /* NetworkError.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEDBD8902D50ABB10086F6A3 /* NetworkError.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -49,6 +65,16 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
254D7B3C2D3CD64E00754A38 /* Genre.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Genre.swift; sourceTree = "<group>"; };
254D7B3F2D3CD9B000754A38 /* GenreInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenreInteractor.swift; sourceTree = "<group>"; };
254D7B422D46977E00754A38 /* Network.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Network.swift; sourceTree = "<group>"; };
254D7B442D46B47000754A38 /* GenreView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenreView.swift; sourceTree = "<group>"; };
254D7B462D46B48A00754A38 /* GenrePresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenrePresenter.swift; sourceTree = "<group>"; };
254D7B482D46B49900754A38 /* GenreRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenreRouter.swift; sourceTree = "<group>"; };
254D7B4E2D4784D900754A38 /* UserdefaultKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserdefaultKey.swift; sourceTree = "<group>"; };
254D7B502D47A9C000754A38 /* PreviousButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviousButton.swift; sourceTree = "<group>"; };
254D7B562D4F9A4400754A38 /* Bundle+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+Extensions.swift"; sourceTree = "<group>"; };
254D7B5A2D58CF0C00754A38 /* Secret.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Secret.plist; sourceTree = "<group>"; };
279EED45062696CDB6194350 /* Pods-TodayVideo-TodayVideoUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TodayVideo-TodayVideoUITests.release.xcconfig"; path = "Target Support Files/Pods-TodayVideo-TodayVideoUITests/Pods-TodayVideo-TodayVideoUITests.release.xcconfig"; sourceTree = "<group>"; };
2BCFF433EB8A6D8B17F3CEB3 /* Pods_TodayVideo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TodayVideo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
490756C7EB6012C404FAB2E3 /* Pods-TodayVideo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TodayVideo.release.xcconfig"; path = "Target Support Files/Pods-TodayVideo/Pods-TodayVideo.release.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -80,6 +106,12 @@
CE9EAC3A2D2239E300971DB4 /* TodayVideoUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayVideoUITestsLaunchTests.swift; sourceTree = "<group>"; };
CE9EAC482D223B2300971DB4 /* SplashPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashPresenter.swift; sourceTree = "<group>"; };
CE9EAC4A2D223B2D00971DB4 /* SplashRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashRouter.swift; sourceTree = "<group>"; };
CEDBD8852D509D290086F6A3 /* Endpoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Endpoint.swift; sourceTree = "<group>"; };
CEDBD8872D509DE80086F6A3 /* APIEndpoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIEndpoint.swift; sourceTree = "<group>"; };
CEDBD88A2D50A91E0086F6A3 /* Requestable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Requestable.swift; sourceTree = "<group>"; };
CEDBD88C2D50A9500086F6A3 /* Responsable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Responsable.swift; sourceTree = "<group>"; };
CEDBD88E2D50A9E00086F6A3 /* Encodable+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Encodable+Extensions.swift"; sourceTree = "<group>"; };
CEDBD8902D50ABB10086F6A3 /* NetworkError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkError.swift; sourceTree = "<group>"; };
FFB8528AC96E0E4545364CA7 /* Pods_TodayVideo_TodayVideoUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TodayVideo_TodayVideoUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -111,6 +143,52 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
254D7B3A2D3CD5CD00754A38 /* GenreView */ = {
isa = PBXGroup;
children = (
254D7B442D46B47000754A38 /* GenreView.swift */,
254D7B462D46B48A00754A38 /* GenrePresenter.swift */,
254D7B482D46B49900754A38 /* GenreRouter.swift */,
254D7B3E2D3CD99000754A38 /* GenreInterator */,
);
path = GenreView;
sourceTree = "<group>";
};
254D7B3B2D3CD63600754A38 /* Model */ = {
isa = PBXGroup;
children = (
254D7B3C2D3CD64E00754A38 /* Genre.swift */,
);
path = Model;
sourceTree = "<group>";
};
254D7B3E2D3CD99000754A38 /* GenreInterator */ = {
isa = PBXGroup;
children = (
254D7B3B2D3CD63600754A38 /* Model */,
254D7B3F2D3CD9B000754A38 /* GenreInteractor.swift */,
);
path = GenreInterator;
sourceTree = "<group>";
};
254D7B412D46975400754A38 /* Network */ = {
isa = PBXGroup;
children = (
254D7B422D46977E00754A38 /* Network.swift */,
CEDBD8902D50ABB10086F6A3 /* NetworkError.swift */,
CEDBD8892D50A9100086F6A3 /* Endpoint */,
);
path = Network;
sourceTree = "<group>";
};
254D7B4D2D4784BE00754A38 /* Manager */ = {
isa = PBXGroup;
children = (
254D7B4E2D4784D900754A38 /* UserdefaultKey.swift */,
);
path = Manager;
sourceTree = "<group>";
};
A1336E4CE0BFF2843C2B8602 /* Frameworks */ = {
isa = PBXGroup;
children = (
Expand All @@ -127,6 +205,8 @@
CE0F3FF22D374BA40058CEAE /* UIColor+Extensions.swift */,
CE0F3FFD2D38A2850058CEAE /* UIImage+Extension.swift */,
CE0F40042D39D2B80058CEAE /* String+Extension.swift */,
254D7B562D4F9A4400754A38 /* Bundle+Extensions.swift */,
CEDBD88E2D50A9E00086F6A3 /* Encodable+Extensions.swift */,
);
path = Extension;
sourceTree = "<group>";
Expand All @@ -146,6 +226,7 @@
children = (
CE0F40002D38A6590058CEAE /* FilterButton.swift */,
CE0F40022D38E0720058CEAE /* NextButton.swift */,
254D7B502D47A9C000754A38 /* PreviousButton.swift */,
);
path = Common;
sourceTree = "<group>";
Expand Down Expand Up @@ -181,10 +262,14 @@
CE9EAC202D2239E200971DB4 /* Assets.xcassets */,
CE9EAC222D2239E200971DB4 /* LaunchScreen.storyboard */,
CE9EAC252D2239E200971DB4 /* Info.plist */,
254D7B5A2D58CF0C00754A38 /* Secret.plist */,
254D7B4D2D4784BE00754A38 /* Manager */,
254D7B412D46975400754A38 /* Network */,
CE0F3FFF2D38A63F0058CEAE /* Common */,
CE0F3FF12D374B0F0058CEAE /* Extension */,
CE9EAC472D223ACC00971DB4 /* SplashView */,
CE0F3FF42D3771220058CEAE /* ContentView */,
254D7B3A2D3CD5CD00754A38 /* GenreView */,
);
path = TodayVideo;
sourceTree = "<group>";
Expand Down Expand Up @@ -216,6 +301,17 @@
path = SplashView;
sourceTree = "<group>";
};
CEDBD8892D50A9100086F6A3 /* Endpoint */ = {
isa = PBXGroup;
children = (
CEDBD88A2D50A91E0086F6A3 /* Requestable.swift */,
CEDBD88C2D50A9500086F6A3 /* Responsable.swift */,
CEDBD8852D509D290086F6A3 /* Endpoint.swift */,
CEDBD8872D509DE80086F6A3 /* APIEndpoint.swift */,
);
path = Endpoint;
sourceTree = "<group>";
};
DEB378AA6A5B467FAB2AF79E /* Pods */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -338,6 +434,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
254D7B5B2D58CF0C00754A38 /* Secret.plist in Resources */,
CE9EAC212D2239E200971DB4 /* Assets.xcassets in Resources */,
CE9EAC242D2239E200971DB4 /* Base in Resources */,
CE9EAC1F2D2239E100971DB4 /* Base in Resources */,
Expand Down Expand Up @@ -468,19 +565,34 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
254D7B512D47A9C000754A38 /* PreviousButton.swift in Sources */,
254D7B4F2D4784D900754A38 /* UserdefaultKey.swift in Sources */,
CE9EAC1C2D2239E100971DB4 /* SplashView.swift in Sources */,
CE0F3FF32D374BA40058CEAE /* UIColor+Extensions.swift in Sources */,
254D7B432D46977E00754A38 /* Network.swift in Sources */,
254D7B452D46B47000754A38 /* GenreView.swift in Sources */,
CE0F3FF62D37714B0058CEAE /* ContentView.swift in Sources */,
CEDBD8882D509DE80086F6A3 /* APIEndpoint.swift in Sources */,
CE9EAC182D2239E100971DB4 /* AppDelegate.swift in Sources */,
254D7B472D46B48A00754A38 /* GenrePresenter.swift in Sources */,
CEDBD88B2D50A91E0086F6A3 /* Requestable.swift in Sources */,
254D7B402D3CD9B000754A38 /* GenreInteractor.swift in Sources */,
CEDBD8912D50ABB10086F6A3 /* NetworkError.swift in Sources */,
254D7B492D46B49900754A38 /* GenreRouter.swift in Sources */,
CE0F3FF82D3771C80058CEAE /* ContentPresenter.swift in Sources */,
CE9EAC4B2D223B2D00971DB4 /* SplashRouter.swift in Sources */,
254D7B572D4F9A4400754A38 /* Bundle+Extensions.swift in Sources */,
CE0F40032D38E0720058CEAE /* NextButton.swift in Sources */,
CE0F40012D38A6590058CEAE /* FilterButton.swift in Sources */,
CEDBD88D2D50A9500086F6A3 /* Responsable.swift in Sources */,
CE9EAC492D223B2300971DB4 /* SplashPresenter.swift in Sources */,
CEDBD8862D509D290086F6A3 /* Endpoint.swift in Sources */,
CE0F3FFE2D38A2850058CEAE /* UIImage+Extension.swift in Sources */,
CEDBD88F2D50A9E00086F6A3 /* Encodable+Extensions.swift in Sources */,
CE0F40052D39D2B80058CEAE /* String+Extension.swift in Sources */,
CE9EAC1A2D2239E100971DB4 /* SceneDelegate.swift in Sources */,
CE0F3FFA2D3771D40058CEAE /* ContentRouter.swift in Sources */,
254D7B3D2D3CD64E00754A38 /* Genre.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -673,6 +785,7 @@
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -704,6 +817,7 @@
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "Vector.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions TodayVideo/TodayVideo/Common/FilterButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import UIKit

final class FilterButton: UIButton {
let height: CGFloat = 50.0
private let leftRightMargin: CGFloat = 60.0
private let fontSize: CGFloat = 17
private let height: CGFloat = 50.0
private let leftRightMargin: CGFloat = 70.0
private var title = ""
Expand All @@ -17,6 +20,7 @@ final class FilterButton: UIButton {

self.title = title
self.setTitle(title, for: .normal)
self.titleLabel?.font = .systemFont(ofSize: fontSize)
self.layer.cornerRadius = height / 2
}

Expand All @@ -25,6 +29,7 @@ final class FilterButton: UIButton {
}

func width() -> CGFloat {
let titleWidth = title.width(size: fontSize)
let titleWidth = title.width(size: 20)
return titleWidth + leftRightMargin
}
Expand Down
40 changes: 40 additions & 0 deletions TodayVideo/TodayVideo/Common/PreviousButton.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// PreviousButton.swift
// TodayVideo
//
// Created by 김지나 on 1/27/25.
//

import Foundation
import SnapKit

final class PreviousButton: UIButton {
private var currentView: UIViewController!

init(location: UIViewController) {
super.init(frame: .zero)

self.currentView = location
self.setImage(.previousButton, for: .normal)
self.addTarget(self, action: #selector(popToPreviousView), for: .touchUpInside)
self.currentView.view.addSubview(self)
self.layout(in: currentView.view)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

func layout(in view: UIView) {
self.snp.makeConstraints { make in
make.width.equalTo(15.4)
make.height.equalTo(23)
make.leading.equalTo(view.snp.leading).offset(41.6)
make.top.equalTo(view.safeAreaLayoutGuide).offset(27.27)
}
}

@objc private func popToPreviousView() {
currentView.navigationController?.popViewController(animated: true)
}
}
5 changes: 4 additions & 1 deletion TodayVideo/TodayVideo/ContentView/ContentRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ final class ContentRouter: ContentRouterProtocol {

// 장르 선택 화면으로 push
func pushToGenreView() {
// 다음 화면으로 이동을 위한 처리 코드 입니다.
let genreView = GenreRouter.createGenreViewModule()
contentView?.navigationController?.pushViewController(genreView, animated: true)

// 다음 화면으로 이동을 위한 처리 코드 입니다.
// let genreView = GenreRouter.createGenre
// contentView?.navigationController?.pushViewController(genreView, animated: true)
}
Expand Down
Loading

0 comments on commit a510735

Please sign in to comment.