diff --git a/Drink-EG/Drink-EG.xcodeproj/project.pbxproj b/Drink-EG/Drink-EG.xcodeproj/project.pbxproj index e116ee8..5ef4af3 100644 --- a/Drink-EG/Drink-EG.xcodeproj/project.pbxproj +++ b/Drink-EG/Drink-EG.xcodeproj/project.pbxproj @@ -29,6 +29,10 @@ 165401092C6BA644008A9DBF /* MemberInfoAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165401082C6BA644008A9DBF /* MemberInfoAPI.swift */; }; 1654010B2C6BACDC008A9DBF /* SelectionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1654010A2C6BACDC008A9DBF /* SelectionManager.swift */; }; 1654010D2C6C7FBB008A9DBF /* APIResponseMemberResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1654010C2C6C7FBB008A9DBF /* APIResponseMemberResponse.swift */; }; + 1654010F2C6E2B4B008A9DBF /* MyCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1654010E2C6E2B4B008A9DBF /* MyCollectionViewController.swift */; }; + 165401112C6E2B79008A9DBF /* WineNewsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165401102C6E2B79008A9DBF /* WineNewsViewController.swift */; }; + 165401132C6E2BAA008A9DBF /* WineKnowledgeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165401122C6E2BAA008A9DBF /* WineKnowledgeViewController.swift */; }; + 165401162C6E3858008A9DBF /* CardSlider in Frameworks */ = {isa = PBXBuildFile; productRef = 165401152C6E3858008A9DBF /* CardSlider */; }; 16752F9D2C5A7FB90001907D /* HexCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16752F9C2C5A7FB90001907D /* HexCode.swift */; }; 16B97CD42C4BEB0900D8B453 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16B97CD32C4BEB0900D8B453 /* AppDelegate.swift */; }; 16B97CD62C4BEB0900D8B453 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16B97CD52C4BEB0900D8B453 /* SceneDelegate.swift */; }; @@ -129,6 +133,9 @@ 165401082C6BA644008A9DBF /* MemberInfoAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemberInfoAPI.swift; sourceTree = ""; }; 1654010A2C6BACDC008A9DBF /* SelectionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectionManager.swift; sourceTree = ""; }; 1654010C2C6C7FBB008A9DBF /* APIResponseMemberResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIResponseMemberResponse.swift; sourceTree = ""; }; + 1654010E2C6E2B4B008A9DBF /* MyCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyCollectionViewController.swift; sourceTree = ""; }; + 165401102C6E2B79008A9DBF /* WineNewsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WineNewsViewController.swift; sourceTree = ""; }; + 165401122C6E2BAA008A9DBF /* WineKnowledgeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WineKnowledgeViewController.swift; sourceTree = ""; }; 16752F9C2C5A7FB90001907D /* HexCode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexCode.swift; sourceTree = ""; }; 16B97CD02C4BEB0900D8B453 /* Drink-EG.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Drink-EG.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 16B97CD32C4BEB0900D8B453 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -208,6 +215,7 @@ files = ( 5E2219712C6B5B5B005849FB /* Cosmos in Frameworks */, 5E22195E2C69DDB5005849FB /* SnapKit in Frameworks */, + 165401162C6E3858008A9DBF /* CardSlider in Frameworks */, 5E2219672C69DE78005849FB /* KakaoSDK in Frameworks */, 5E2219612C69DDBF005849FB /* Alamofire in Frameworks */, 5E22196A2C69DEEA005849FB /* Toast in Frameworks */, @@ -438,6 +446,9 @@ 16B97D132C4C0F4100D8B453 /* ClassVideoViewController.swift */, 16B97D152C4C0F6400D8B453 /* SavingVideoViewController.swift */, 16B97D172C4C0F6E00D8B453 /* SearchVideoViewController.swift */, + 1654010E2C6E2B4B008A9DBF /* MyCollectionViewController.swift */, + 165401102C6E2B79008A9DBF /* WineNewsViewController.swift */, + 165401122C6E2BAA008A9DBF /* WineKnowledgeViewController.swift */, ); path = WineClass; sourceTree = ""; @@ -531,6 +542,7 @@ 5E2219662C69DE78005849FB /* KakaoSDK */, 5E2219692C69DEEA005849FB /* Toast */, 5E2219702C6B5B5B005849FB /* Cosmos */, + 165401152C6E3858008A9DBF /* CardSlider */, ); productName = "Drink-EG"; productReference = 16B97CD02C4BEB0900D8B453 /* Drink-EG.app */; @@ -567,6 +579,7 @@ 5E2219652C69DE78005849FB /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */, 5E2219682C69DEEA005849FB /* XCRemoteSwiftPackageReference "Toast-Swift" */, 5E22196F2C6B5B5B005849FB /* XCRemoteSwiftPackageReference "Cosmos" */, + 165401142C6E3858008A9DBF /* XCRemoteSwiftPackageReference "cardslider" */, ); productRefGroup = 16B97CD12C4BEB0900D8B453 /* Products */; projectDirPath = ""; @@ -626,6 +639,7 @@ 1F598EFD2C58150E000CE79F /* JoinViewController.swift in Sources */, 165400E32C69D6B9008A9DBF /* CallMoyaExample.swift in Sources */, 165400E72C69DDBE008A9DBF /* TastingNoteAPI.swift in Sources */, + 1654010F2C6E2B4B008A9DBF /* MyCollectionViewController.swift in Sources */, 16B97CEC2C4BF37E00D8B453 /* Constant.swift in Sources */, 16B97D182C4C0F6E00D8B453 /* SearchVideoViewController.swift in Sources */, 1F598EEC2C524D2E000CE79F /* RecomCollectionViewCell.swift in Sources */, @@ -654,6 +668,7 @@ 1F3CEAD62C669FD2002A4BC0 /* WineListCollectionViewCell.swift in Sources */, 165401042C69FA13008A9DBF /* APIResponseString.swift in Sources */, 165400E12C69D6B9008A9DBF /* BasicAPI.swift in Sources */, + 165401112C6E2B79008A9DBF /* WineNewsViewController.swift in Sources */, 165400E52C69DDB6008A9DBF /* LoginAPI.swift in Sources */, 5E2219412C69D5D0005849FB /* CustomTableViewCell.swift in Sources */, 1F598F012C581573000CE79F /* LoginViewController.swift in Sources */, @@ -682,6 +697,7 @@ 5E2219442C69D5D0005849FB /* CreateNewCommViewController.swift in Sources */, 5E2219472C69D5D0005849FB /* CustomCollectionViewCell.swift in Sources */, 5E22195B2C69D5E7005849FB /* WriteNoteViewController.swift in Sources */, + 165401132C6E2BAA008A9DBF /* WineKnowledgeViewController.swift in Sources */, 165400EF2C69DDFF008A9DBF /* WineNewsBookmarkAPI.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -897,6 +913,14 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ + 165401142C6E3858008A9DBF /* XCRemoteSwiftPackageReference "cardslider" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/Ramotion/cardslider.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 0.1.0; + }; + }; 5E22195C2C69DDB5005849FB /* XCRemoteSwiftPackageReference "SnapKit" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SnapKit/SnapKit.git"; @@ -948,6 +972,11 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ + 165401152C6E3858008A9DBF /* CardSlider */ = { + isa = XCSwiftPackageProductDependency; + package = 165401142C6E3858008A9DBF /* XCRemoteSwiftPackageReference "cardslider" */; + productName = CardSlider; + }; 5E22195D2C69DDB5005849FB /* SnapKit */ = { isa = XCSwiftPackageProductDependency; package = 5E22195C2C69DDB5005849FB /* XCRemoteSwiftPackageReference "SnapKit" */; diff --git a/Drink-EG/Drink-EG.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Drink-EG/Drink-EG.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3413622..838c2c4 100644 --- a/Drink-EG/Drink-EG.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Drink-EG/Drink-EG.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "94393d098153cbd97eec19a1c56e156b79e10a5cb07e1198ba426834b6a505ba", + "originHash" : "ae843fcd9fde0e0eb90792d861b014bf16f661547950eb4147c039184b74fb38", "pins" : [ { "identity" : "alamofire", @@ -10,6 +10,15 @@ "version" : "5.9.1" } }, + { + "identity" : "cardslider", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Ramotion/cardslider.git", + "state" : { + "revision" : "016e2996d9f9fc20ac108ad82fd9fce007546be1", + "version" : "0.1.0" + } + }, { "identity" : "cosmos", "kind" : "remoteSourceControl", @@ -58,7 +67,7 @@ { "identity" : "snapkit", "kind" : "remoteSourceControl", - "location" : "https://github.com/SnapKit/SnapKit.git", + "location" : "https://github.com/SnapKit/SnapKit", "state" : { "revision" : "2842e6e84e82eb9a8dac0100ca90d9444b0307f4", "version" : "5.7.1" diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/ClassSampleImage.imageset/Contents.json b/Drink-EG/Drink-EG/Resources/Assets.xcassets/ClassSampleImage.imageset/Contents.json new file mode 100644 index 0000000..930b26a --- /dev/null +++ b/Drink-EG/Drink-EG/Resources/Assets.xcassets/ClassSampleImage.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "wineImage.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/ClassSampleImage.imageset/wineImage.jpg b/Drink-EG/Drink-EG/Resources/Assets.xcassets/ClassSampleImage.imageset/wineImage.jpg new file mode 100644 index 0000000..f9145e6 Binary files /dev/null and b/Drink-EG/Drink-EG/Resources/Assets.xcassets/ClassSampleImage.imageset/wineImage.jpg differ diff --git a/Drink-EG/Drink-EG/Resources/SceneDelegate.swift b/Drink-EG/Drink-EG/Resources/SceneDelegate.swift index 1ac98e7..5b4d75b 100644 --- a/Drink-EG/Drink-EG/Resources/SceneDelegate.swift +++ b/Drink-EG/Drink-EG/Resources/SceneDelegate.swift @@ -21,7 +21,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { let window = UIWindow(windowScene: windowScene) // 실제 첫 화면이 되는 MainViewController 인스턴스 생성 // let vc = ThirdVarietyTasteTestViewController() - let vc = EnterLoginViewController() + let vc = MainTabBarViewController() // NavigationController을 사용할 경우, MainViewController를 rootViewController로 갖는 NavigationController을 생성해야한다. let navigationController = UINavigationController(rootViewController: vc) navigationController.isNavigationBarHidden = true diff --git a/Drink-EG/Drink-EG/Sources/VCs/WineClass/MyCollectionViewController.swift b/Drink-EG/Drink-EG/Sources/VCs/WineClass/MyCollectionViewController.swift new file mode 100644 index 0000000..eb5c66c --- /dev/null +++ b/Drink-EG/Drink-EG/Sources/VCs/WineClass/MyCollectionViewController.swift @@ -0,0 +1,17 @@ +// +// MyCollectionViewController.swift +// Drink-EG +// +// Created by 김도연 on 8/15/24. +// + +import UIKit +import SnapKit + +class MyCollectionViewController: UIViewController { + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .white + title = "내 보관함" + } +} diff --git a/Drink-EG/Drink-EG/Sources/VCs/WineClass/SavingVideoViewController.swift b/Drink-EG/Drink-EG/Sources/VCs/WineClass/SavingVideoViewController.swift index aa5f66b..ca3b5d3 100644 --- a/Drink-EG/Drink-EG/Sources/VCs/WineClass/SavingVideoViewController.swift +++ b/Drink-EG/Drink-EG/Sources/VCs/WineClass/SavingVideoViewController.swift @@ -6,3 +6,8 @@ // import Foundation +import UIKit + +class SavingVideoViewController : UIViewController { + +} diff --git a/Drink-EG/Drink-EG/Sources/VCs/WineClass/WineClassMainViewController.swift b/Drink-EG/Drink-EG/Sources/VCs/WineClass/WineClassMainViewController.swift index 60661a7..ec7bb86 100644 --- a/Drink-EG/Drink-EG/Sources/VCs/WineClass/WineClassMainViewController.swift +++ b/Drink-EG/Drink-EG/Sources/VCs/WineClass/WineClassMainViewController.swift @@ -6,11 +6,190 @@ // import UIKit +import SnapKit class WineClassMainViewController : UIViewController { + + // "VINO 클래스" 타이틀 + private let titleLabel: UILabel = { + let label = UILabel() + label.text = "VINO 클래스" + label.font = UIFont.boldSystemFont(ofSize: 28) + label.textColor = .black + return label + }() + + // 검색창 + private let searchBar: UISearchBar = { + let searchBar = UISearchBar() + searchBar.placeholder = "제목, 연관내용 검색" + searchBar.backgroundImage = UIImage() // 배경을 없앰 + return searchBar + }() + + // "내 보관함" 버튼 + private let myCollectionButton: UIButton = { + let button = UIButton(type: .system) + button.setTitle("내 보관함", for: .normal) + button.setTitleColor(.black, for: .normal) + button.backgroundColor = UIColor.white + button.layer.cornerRadius = 15 + button.addTarget(WineClassMainViewController.self, action: #selector(didTapMyCollectionButton), for: .touchUpInside) + return button + }() + + + + // "15초만에 알아가는 와인 지식" 카드 뷰 + private let wineKnowledgeCardView: UIView = { + let view = UIView() + view.backgroundColor = UIColor.white + view.layer.cornerRadius = 10 + view.layer.shadowColor = UIColor.black.cgColor + view.layer.shadowOpacity = 0.1 + view.layer.shadowOffset = CGSize(width: 0, height: 2) + view.layer.shadowRadius = 4 + let tapGesture = UITapGestureRecognizer(target: WineClassMainViewController.self, action: #selector(didTapWineKnowledgeCard)) + view.addGestureRecognizer(tapGesture) + view.isUserInteractionEnabled = true + return view + }() + + // 카드 이미지뷰 + private let cardImageView: UIImageView = { + let imageView = UIImageView(image: UIImage(named: "ClassSampleImage")) + imageView.contentMode = .scaleAspectFill + imageView.layer.cornerRadius = 10 + imageView.layer.masksToBounds = true + return imageView + }() + + // "15초만에 알아가는 와인 지식" 라벨 + private let wineKnowledgeLabel: UILabel = { + let label = UILabel() + label.text = "15초만에 알아가는 와인 지식" + label.font = UIFont.systemFont(ofSize: 20, weight: .bold) + label.textColor = .black + return label + }() + + // "이번 달 와인뉴스" 카드 뷰 + private let wineNewsCardView: UIView = { + let view = UIView() + view.backgroundColor = UIColor.white + view.layer.cornerRadius = 10 + view.layer.shadowColor = UIColor.black.cgColor + view.layer.shadowOpacity = 0.1 + view.layer.shadowOffset = CGSize(width: 0, height: 2) + view.layer.shadowRadius = 4 + let tapGesture = UITapGestureRecognizer(target: WineClassMainViewController.self, action: #selector(didTapWineNewsCard)) + view.addGestureRecognizer(tapGesture) + view.isUserInteractionEnabled = true + return view + }() + + // "이번 달 와인뉴스" 카드 이미지뷰 + private let newsImageView: UIImageView = { + let imageView = UIImageView(image: UIImage(named: "ClassSampleImage")) + imageView.contentMode = .scaleAspectFill + imageView.layer.cornerRadius = 10 + imageView.layer.masksToBounds = true + return imageView + }() + + // "이번 달 와인뉴스" 라벨 + private let wineNewsLabel: UILabel = { + let label = UILabel() + label.text = "이번 달 와인뉴스" + label.font = UIFont.systemFont(ofSize: 20, weight: .bold) + label.textColor = .black + return label + }() + override func viewDidLoad() { super.viewDidLoad() - view.backgroundColor = .purple + view.backgroundColor = .white + setupUI() + } + + private func setupUI() { + // Add subviews + view.addSubview(titleLabel) + view.addSubview(searchBar) + view.addSubview(wineKnowledgeCardView) + view.addSubview(myCollectionButton) + view.addSubview(wineNewsCardView) + + wineKnowledgeCardView.addSubview(cardImageView) + wineKnowledgeCardView.addSubview(wineKnowledgeLabel) + + wineNewsCardView.addSubview(newsImageView) + wineNewsCardView.addSubview(wineNewsLabel) + + // Layout constraints using SnapKit + titleLabel.snp.makeConstraints { make in + make.top.equalTo(view.safeAreaLayoutGuide).offset(20) + make.leading.equalToSuperview().offset(16) + } + + searchBar.snp.makeConstraints { make in + make.top.equalTo(titleLabel.snp.bottom).offset(10) + make.leading.trailing.equalToSuperview().inset(16) + } + + wineKnowledgeCardView.snp.makeConstraints { make in + make.top.equalTo(searchBar.snp.bottom).offset(20) + make.leading.trailing.equalToSuperview().inset(16) + make.height.equalTo(200) + } + + cardImageView.snp.makeConstraints { make in + make.edges.equalToSuperview() + } + + wineKnowledgeLabel.snp.makeConstraints { make in + make.bottom.equalToSuperview().inset(10) + make.leading.equalToSuperview().offset(10) + } + + myCollectionButton.snp.makeConstraints { make in + make.trailing.equalTo(wineKnowledgeCardView.snp.trailing).inset(16) + make.centerY.equalTo(wineKnowledgeCardView.snp.centerY) + make.height.equalTo(30) + make.width.equalTo(100) + } + + wineNewsCardView.snp.makeConstraints { make in + make.top.equalTo(wineKnowledgeCardView.snp.bottom).offset(40) + make.leading.trailing.equalToSuperview().inset(16) + make.height.equalTo(200) + } + + newsImageView.snp.makeConstraints { make in + make.edges.equalToSuperview() + } + + wineNewsLabel.snp.makeConstraints { make in + make.bottom.equalToSuperview().inset(10) + make.leading.equalToSuperview().offset(10) + } + } + + // MARK: - Actions + + @objc private func didTapMyCollectionButton() { + let myCollectionViewController = MyCollectionViewController() + navigationController?.pushViewController(myCollectionViewController, animated: true) + } + + @objc private func didTapWineKnowledgeCard() { + let wineKnowledgeViewController = WineKnowledgeViewController() + navigationController?.pushViewController(wineKnowledgeViewController, animated: true) + } + + @objc private func didTapWineNewsCard() { + let wineNewsViewController = WineNewsViewController() + navigationController?.pushViewController(wineNewsViewController, animated: true) } } diff --git a/Drink-EG/Drink-EG/Sources/VCs/WineClass/WineKnowledgeViewController.swift b/Drink-EG/Drink-EG/Sources/VCs/WineClass/WineKnowledgeViewController.swift new file mode 100644 index 0000000..553b900 --- /dev/null +++ b/Drink-EG/Drink-EG/Sources/VCs/WineClass/WineKnowledgeViewController.swift @@ -0,0 +1,17 @@ +// +// WineKnowledgeViewController.swift +// Drink-EG +// +// Created by 김도연 on 8/15/24. +// + +import UIKit +import SnapKit + +class WineKnowledgeViewController: UIViewController { + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .white + title = "와인 지식" + } +} diff --git a/Drink-EG/Drink-EG/Sources/VCs/WineClass/WineNewsViewController.swift b/Drink-EG/Drink-EG/Sources/VCs/WineClass/WineNewsViewController.swift new file mode 100644 index 0000000..0a27809 --- /dev/null +++ b/Drink-EG/Drink-EG/Sources/VCs/WineClass/WineNewsViewController.swift @@ -0,0 +1,17 @@ +// +// WineNewsViewController.swift +// Drink-EG +// +// Created by 김도연 on 8/15/24. +// + +import UIKit +import SnapKit + +class WineNewsViewController: UIViewController { + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .white + title = "와인 뉴스" + } +}