Skip to content

Commit

Permalink
#43 Chore: Sliding Cards Deck UI package 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
doyeonk429 committed Aug 15, 2024
1 parent a7260fe commit 7cd155b
Show file tree
Hide file tree
Showing 10 changed files with 298 additions and 4 deletions.
29 changes: 29 additions & 0 deletions Drink-EG/Drink-EG.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -129,6 +133,9 @@
165401082C6BA644008A9DBF /* MemberInfoAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemberInfoAPI.swift; sourceTree = "<group>"; };
1654010A2C6BACDC008A9DBF /* SelectionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectionManager.swift; sourceTree = "<group>"; };
1654010C2C6C7FBB008A9DBF /* APIResponseMemberResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIResponseMemberResponse.swift; sourceTree = "<group>"; };
1654010E2C6E2B4B008A9DBF /* MyCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyCollectionViewController.swift; sourceTree = "<group>"; };
165401102C6E2B79008A9DBF /* WineNewsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WineNewsViewController.swift; sourceTree = "<group>"; };
165401122C6E2BAA008A9DBF /* WineKnowledgeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WineKnowledgeViewController.swift; sourceTree = "<group>"; };
16752F9C2C5A7FB90001907D /* HexCode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexCode.swift; sourceTree = "<group>"; };
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 = "<group>"; };
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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 = "<group>";
Expand Down Expand Up @@ -531,6 +542,7 @@
5E2219662C69DE78005849FB /* KakaoSDK */,
5E2219692C69DEEA005849FB /* Toast */,
5E2219702C6B5B5B005849FB /* Cosmos */,
165401152C6E3858008A9DBF /* CardSlider */,
);
productName = "Drink-EG";
productReference = 16B97CD02C4BEB0900D8B453 /* Drink-EG.app */;
Expand Down Expand Up @@ -567,6 +579,7 @@
5E2219652C69DE78005849FB /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */,
5E2219682C69DEEA005849FB /* XCRemoteSwiftPackageReference "Toast-Swift" */,
5E22196F2C6B5B5B005849FB /* XCRemoteSwiftPackageReference "Cosmos" */,
165401142C6E3858008A9DBF /* XCRemoteSwiftPackageReference "cardslider" */,
);
productRefGroup = 16B97CD12C4BEB0900D8B453 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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" */;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "94393d098153cbd97eec19a1c56e156b79e10a5cb07e1198ba426834b6a505ba",
"originHash" : "ae843fcd9fde0e0eb90792d861b014bf16f661547950eb4147c039184b74fb38",
"pins" : [
{
"identity" : "alamofire",
Expand All @@ -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",
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Drink-EG/Drink-EG/Resources/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 = "내 보관함"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@
//

import Foundation
import UIKit

class SavingVideoViewController : UIViewController {

}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Loading

0 comments on commit 7cd155b

Please sign in to comment.