Skip to content

Commit

Permalink
#38 Feat: 와인 클래스 UI 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoyeonl committed Aug 12, 2024
1 parent 86425be commit d49467c
Show file tree
Hide file tree
Showing 9 changed files with 1,496 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Drink-EG/Drink-EG.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
16B97D322C4CE68A00D8B453 /* KakaoSDK in Frameworks */ = {isa = PBXBuildFile; productRef = 16B97D312C4CE68A00D8B453 /* KakaoSDK */; };
16B97D352C4D062E00D8B453 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 16B97D342C4D062E00D8B453 /* SnapKit */; };
16B97D372C4D062E00D8B453 /* SnapKit-Dynamic in Frameworks */ = {isa = PBXBuildFile; productRef = 16B97D362C4D062E00D8B453 /* SnapKit-Dynamic */; };
C3E15C682C69F3F6002BF034 /* ClassVideoBottomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E15C672C69F3F6002BF034 /* ClassVideoBottomViewController.swift */; };
C3E15C6A2C69F524002BF034 /* MyPageController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E15C692C69F524002BF034 /* MyPageController.swift */; };
C3E15C6C2C69F533002BF034 /* MyinfoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E15C6B2C69F533002BF034 /* MyinfoController.swift */; };
C3E15C6E2C69F610002BF034 /* SavingVideoBottomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E15C6D2C69F610002BF034 /* SavingVideoBottomViewController.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -71,6 +75,10 @@
16B97D1F2C4C0FDB00D8B453 /* SearchCommunityViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchCommunityViewController.swift; sourceTree = "<group>"; };
16B97D212C4C0FEB00D8B453 /* CommunityListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityListViewController.swift; sourceTree = "<group>"; };
16B97D232C4C0FFE00D8B453 /* CreateNewCommViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateNewCommViewController.swift; sourceTree = "<group>"; };
C3E15C672C69F3F6002BF034 /* ClassVideoBottomViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassVideoBottomViewController.swift; sourceTree = "<group>"; };
C3E15C692C69F524002BF034 /* MyPageController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageController.swift; sourceTree = "<group>"; };
C3E15C6B2C69F533002BF034 /* MyinfoController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyinfoController.swift; sourceTree = "<group>"; };
C3E15C6D2C69F610002BF034 /* SavingVideoBottomViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SavingVideoBottomViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -234,9 +242,13 @@
isa = PBXGroup;
children = (
16B97D112C4C0F2400D8B453 /* WineClassMainViewController.swift */,
C3E15C672C69F3F6002BF034 /* ClassVideoBottomViewController.swift */,
16B97D132C4C0F4100D8B453 /* ClassVideoViewController.swift */,
16B97D152C4C0F6400D8B453 /* SavingVideoViewController.swift */,
C3E15C6D2C69F610002BF034 /* SavingVideoBottomViewController.swift */,
16B97D172C4C0F6E00D8B453 /* SearchVideoViewController.swift */,
C3E15C692C69F524002BF034 /* MyPageController.swift */,
C3E15C6B2C69F533002BF034 /* MyinfoController.swift */,
);
path = WineClass;
sourceTree = "<group>";
Expand Down Expand Up @@ -364,6 +376,7 @@
16B97CEC2C4BF37E00D8B453 /* Constant.swift in Sources */,
16B97D182C4C0F6E00D8B453 /* SearchVideoViewController.swift in Sources */,
16B97D0C2C4C0DAA00D8B453 /* AddNewNoteViewController.swift in Sources */,
C3E15C6E2C69F610002BF034 /* SavingVideoBottomViewController.swift in Sources */,
16B97D002C4BFC7300D8B453 /* ShoppingCartListViewController.swift in Sources */,
16B97D0E2C4C0E6300D8B453 /* WriteNoteViewController.swift in Sources */,
16B97CD42C4BEB0900D8B453 /* AppDelegate.swift in Sources */,
Expand All @@ -372,12 +385,15 @@
16B97D102C4C0E9000D8B453 /* NoteInfoViewController.swift in Sources */,
16B97D242C4C0FFE00D8B453 /* CreateNewCommViewController.swift in Sources */,
16B97D122C4C0F2400D8B453 /* WineClassMainViewController.swift in Sources */,
C3E15C6C2C69F533002BF034 /* MyinfoController.swift in Sources */,
16B97D0A2C4C0D8F00D8B453 /* NoteListViewController.swift in Sources */,
16B97D062C4C0CF800D8B453 /* WineStoreListViewController.swift in Sources */,
C3E15C682C69F3F6002BF034 /* ClassVideoBottomViewController.swift in Sources */,
16B97D1E2C4C0FCA00D8B453 /* CommunityInfoViewController.swift in Sources */,
16B97D202C4C0FDB00D8B453 /* SearchCommunityViewController.swift in Sources */,
16B97CFE2C4BFC2300D8B453 /* HomeViewController.swift in Sources */,
16B97D142C4C0F4100D8B453 /* ClassVideoViewController.swift in Sources */,
C3E15C6A2C69F524002BF034 /* MyPageController.swift in Sources */,
16B97D022C4BFC9800D8B453 /* SearchHomeViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
//
// ClassVideoBottomViewController.swift
// Drink-EG
//
// Created by 이호연 on 8/12/24.
//

import Foundation

import UIKit
import SnapKit


class ViewController: UIViewController {

let imageView = UIImageView()


override func viewDidLoad() {

super.viewDidLoad()


setupVideo()
configureSheet()
setupVideoViewConstraints()

}


private func setupVideo() {
view.addSubview(imageView)

imageView.overrideUserInterfaceStyle = .dark
imageView.frame = view.bounds
imageView.contentMode = .scaleAspectFill
//imageView.clipsToBounds = true
//imageView.layer.cornerRadius = 40
imageView.image = UIImage(named: "SampleImage")
}

func setupVideoViewConstraints() {
imageView.snp.makeConstraints { make in
//make.top.equalTo(myinfoLabel.snp.bottom).offset(80) // noteListLabel의 아래에 20포인트 여백
make.centerX.equalToSuperview() // 가로축 중앙에 배치
make.height.equalTo(568)
make.width.equalTo(405)

}
}


private func configureSheet() {


let vc = SecondViewController()

let navVC = UINavigationController(rootViewController: vc)

navVC.isModalInPresentation = true

if let sheet = navVC.sheetPresentationController {

sheet.preferredCornerRadius = 40


sheet.detents = [.custom(resolver: {context in
0.4 * context.maximumDetentValue
}), .large()]


sheet.largestUndimmedDetentIdentifier = .large
}
navigationController?.present(navVC, animated: true)
}
}
107 changes: 107 additions & 0 deletions Drink-EG/Drink-EG/Sources/VCs/WineClass/ClassVideoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,110 @@
//

import Foundation


import UIKit

class SecondViewController: UIViewController {

let titleclassLabel = UILabel()
let subTitleclassLabel = UILabel()

let savebutton = UIButton()



override func viewDidLoad() {

super.viewDidLoad()

setupView()
setupTitleClassLabel()
setupTitleClassLabelConstraints()
setupSaveButton()
setupSubtitleClassLabel()
setupSubtitlesLabelConstraints()
view.backgroundColor = .systemGray6


}

func setupView() { // 뷰 설정 함수
//view.addSubview(noteListLabel)
view.addSubview(titleclassLabel)
view.addSubview(subTitleclassLabel)
view.addSubview(savebutton)

}

func setupTitleClassLabel() { // Label의 기본 속성을 설정하는 함수
titleclassLabel.text = "기초 와인 용어! 와인 표현 배우기"
titleclassLabel.font = .boldSystemFont(ofSize: 24)
titleclassLabel.textAlignment = .center
titleclassLabel.textColor = .black
}

func setupTitleClassLabelConstraints() { // Label의 제약 조건을 설정하는 함수
titleclassLabel.snp.makeConstraints{ make in
make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(16)
}
}

func setupSubtitleClassLabel() { // Label의 기본 속성을 설정하는 함수
subTitleclassLabel.text = "와인의 기본용어를 전문가 수준으로 배워낼 수 있는 영상을 만들었습니다. 한국어 자막을 최대한 쉽게 만들어 내느라 너무 고민해서 제 머리털이 다 뽑힐 지경이네요! 이번 영상을 오래 기다리셨던만큼, 와인 용어가 어려워 마음고생하는 많은 분들에게 큰 도움이 되었으면 하는 바램입니다!"
subTitleclassLabel.font = .boldSystemFont(ofSize: 14)
subTitleclassLabel.textAlignment = .left

subTitleclassLabel.textColor = .black
subTitleclassLabel.numberOfLines = 0
subTitleclassLabel.lineBreakMode = .byWordWrapping

}

func setupSubtitlesLabelConstraints() { // Label의 제약 조건을 설정하는 함수
subTitleclassLabel.snp.makeConstraints{ make in
make.top.equalTo(titleclassLabel.snp.bottom).offset(20)
make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(16)
make.trailing.equalTo(view.safeAreaLayoutGuide.snp.trailing).offset(-16)


}
}

func setupSaveButton() {
// UIButton의 기본 설정
savebutton.setTitle("저장하기", for: .normal)
savebutton.setTitleColor(.white, for: .normal)
savebutton.titleLabel?.font = UIFont.boldSystemFont(ofSize: 12)
savebutton.backgroundColor = UIColor(hex: "FA735B")
savebutton.layer.cornerRadius = 20
savebutton.addTarget(self, action: #selector(myinfoButtonTapped), for: .touchUpInside)

// 아이콘 이미지 추가
let icon = UIImage(systemName: "square.badge.plus")
savebutton.setImage(icon, for: .normal)
savebutton.imageView?.tintColor = .white // 아이콘의 색상을 설정할 수 있음

// 아이콘과 텍스트의 위치를 조정
savebutton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 35)
savebutton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 65, bottom: 0, right: 15)

// 제약 조건 설정
savebutton.snp.makeConstraints { make in
make.top.equalTo(subTitleclassLabel.snp.bottom).offset(10)
make.trailing.equalToSuperview().offset(-16) // 화면의 오른쪽에 배치
make.height.equalTo(40)
make.width.equalTo(101)
}
}

@objc func myinfoButtonTapped() {
navigationController?.popViewController(animated: true)
}


}



Loading

0 comments on commit d49467c

Please sign in to comment.