Skip to content

Commit

Permalink
#82 Feat: 홈화면 UI 구현 및 오토레이아웃, 더미데이터 크기 조정
Browse files Browse the repository at this point in the history
  • Loading branch information
dlguszoo committed Sep 29, 2024
1 parent 22d4c43 commit 6f26fdf
Show file tree
Hide file tree
Showing 27 changed files with 180 additions and 219 deletions.
4 changes: 4 additions & 0 deletions Drink-EG/Drink-EG.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
1FBD19552C6D2BF7005C16A8 /* ReviewListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FBD19542C6D2BF7005C16A8 /* ReviewListViewController.swift */; };
1FBD19572C6DDBAB005C16A8 /* ReviewListCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FBD19562C6DDBAB005C16A8 /* ReviewListCollectionViewCell.swift */; };
1FC522272CA91ED000EC0635 /* TabBarShadow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FC522262CA91ED000EC0635 /* TabBarShadow.swift */; };
1FC522292CA933FC00EC0635 /* MenuCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FC522282CA933FC00EC0635 /* MenuCollectionViewCell.swift */; };
5E22192D2C69D592005849FB /* Pretendard-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5E2219242C69D592005849FB /* Pretendard-Bold.otf */; };
5E22192E2C69D592005849FB /* Pretendard-Black.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5E2219252C69D592005849FB /* Pretendard-Black.otf */; };
5E22192F2C69D592005849FB /* Pretendard-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5E2219262C69D592005849FB /* Pretendard-Regular.otf */; };
Expand Down Expand Up @@ -294,6 +295,7 @@
1FBD19542C6D2BF7005C16A8 /* ReviewListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewListViewController.swift; sourceTree = "<group>"; };
1FBD19562C6DDBAB005C16A8 /* ReviewListCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewListCollectionViewCell.swift; sourceTree = "<group>"; };
1FC522262CA91ED000EC0635 /* TabBarShadow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarShadow.swift; sourceTree = "<group>"; };
1FC522282CA933FC00EC0635 /* MenuCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuCollectionViewCell.swift; sourceTree = "<group>"; };
5E2219242C69D592005849FB /* Pretendard-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Bold.otf"; sourceTree = "<group>"; };
5E2219252C69D592005849FB /* Pretendard-Black.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Black.otf"; sourceTree = "<group>"; };
5E2219262C69D592005849FB /* Pretendard-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Regular.otf"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -670,6 +672,7 @@
1F598F022C581A7D000CE79F /* StartLoginCollectionViewCell.swift */,
1F598EEB2C524D2E000CE79F /* RecomCollectionViewCell.swift */,
1F205A302C68BB5200E80659 /* CartListCollectionViewCell.swift */,
1FC522282CA933FC00EC0635 /* MenuCollectionViewCell.swift */,
);
path = Main;
sourceTree = "<group>";
Expand Down Expand Up @@ -975,6 +978,7 @@
5E23147F2C5901BB004E2013 /* (null) in Sources */,
16B97D162C4C0F6400D8B453 /* SavingVideoViewController.swift in Sources */,
165400F82C69EFBD008A9DBF /* WineNewsResponse.swift in Sources */,
1FC522292CA933FC00EC0635 /* MenuCollectionViewCell.swift in Sources */,
165400E92C69DDCB008A9DBF /* WineClassAPI.swift in Sources */,
1F598EEA2C5227C5000CE79F /* AdImageCollectionViewCell.swift in Sources */,
1F205A412C6B540600E80659 /* TasteTestSecondCollectionViewCell.swift in Sources */,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"images" : [
{
"filename" : "자막 중.png",
"filename" : "자막 중.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "자막 중@2x.png",
"filename" : "자막 중@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "자막 중@3x.png",
"filename" : "자막 중@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"images" : [
{
"filename" : "ion_search.png",
"filename" : "search.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ion_search (1).png",
"filename" : "search@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ion_search (2).png",
"filename" : "search@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Rectangle 261.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Rectangle [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Rectangle [email protected]",
"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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ -20,7 +20,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
// 화면을 구성하는 UIWindow 인스턴스 생성
let window = UIWindow(windowScene: windowScene)
// 실제 첫 화면이 되는 MainViewController 인스턴스 생성
let vc = MainTabBarViewController()
let vc = LoginViewController()
// NavigationController을 사용할 경우, MainViewController를 rootViewController로 갖는 NavigationController을 생성해야한다.
let navigationController = UINavigationController(rootViewController: vc)
navigationController.isNavigationBarHidden = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class AdImageCollectionViewCell : UICollectionViewCell {

private func setupUI() {
self.contentView.addSubview(imageView)
self.contentView.layer.cornerRadius = 16
self.contentView.layer.masksToBounds = true

imageView.snp.makeConstraints { make in
make.edges.equalToSuperview()
Expand Down
58 changes: 58 additions & 0 deletions Drink-EG/Drink-EG/Sources/Cells/Main/MenuCollectionViewCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//
// MenuCollectionViewCell.swift
// Drink-EG
//
// Created by 이현주 on 9/29/24.
//

import UIKit

class MenuCollectionViewCell: UICollectionViewCell {

private let menuImage: UIImageView = {
let iv = UIImageView()
iv.backgroundColor = UIColor(hex: "D9D9D9")
return iv
}()

private let menuName: UILabel = {
let l1 = UILabel()
l1.font = .systemFont(ofSize: 12, weight: .regular)
l1.textColor = .black
l1.textAlignment = .center
//l1.numberOfLines = 2
return l1
}()

override init(frame: CGRect) {
super.init(frame: frame)

setupUI()
}

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

//레이아웃까지
private func setupUI() {
self.contentView.addSubview(menuImage)
self.contentView.addSubview(menuName)
self.contentView.layer.cornerRadius = 5
self.contentView.layer.masksToBounds = true


menuImage.snp.makeConstraints { make in
make.edges.equalToSuperview()
}

menuName.snp.makeConstraints { make in
make.leading.trailing.equalToSuperview().inset(5)
make.bottom.equalToSuperview().inset(2)
}
}

func configure(name: String) {
menuName.text = name
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class RecomCollectionViewCell: UICollectionViewCell {
private let label1: UILabel = {
let l1 = UILabel()
l1.font = .systemFont(ofSize: 13, weight: .bold)
l1.textColor = .black
l1.textColor = .white
l1.numberOfLines = 2
//l1.adjustsFontSizeToFitWidth = true
l1.lineBreakMode = .byTruncatingTail // 생략 부호(...)가 꼬리에 위치하도록 설정
Expand All @@ -29,7 +29,7 @@ class RecomCollectionViewCell: UICollectionViewCell {

private let view: UIView = {
let v = UIView()
v.backgroundColor = UIColor(hue: 0.0417, saturation: 0.19, brightness: 1, alpha: 0.7)
v.backgroundColor = UIColor(hue: 0.7389, saturation: 0.89, brightness: 0.69, alpha: 0.7)
return v
}()

Expand Down
Loading

0 comments on commit 6f26fdf

Please sign in to comment.