Skip to content

Commit 42461bf

Browse files
authored
[NL-79]: 홈 화면 미비점 수정 (#51)
* [NL-79]: 홈 화면 배경 설정 * [NL-79]: 번호 추천 상세 뒤로가기 버튼 이벤트 연결 * [NL-79]: 번호 추천 상세 -> 결과 안내 연결 * [NL-79]: 추천 상세 로딩화면 구조 수정
1 parent 99633ed commit 42461bf

File tree

16 files changed

+281
-57
lines changed

16 files changed

+281
-57
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "home-pattern-1.svg",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "home-pattern-2.svg",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "smile-pig.svg",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Lines changed: 72 additions & 0 deletions
Loading
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//
2+
// HomeBackgroundView.swift
3+
// Home
4+
//
5+
// Created by ttozzi on 8/18/25.
6+
//
7+
8+
import DesignSystem
9+
import UIKit
10+
11+
final class HomeBackgroundView: UIView {
12+
13+
private let gradientLayer = CAGradientLayer().then {
14+
$0.colors = [
15+
UIColor(hexString: "#ECE2FF").cgColor,
16+
UIColor(hexString: "#F4F3F5").cgColor,
17+
]
18+
$0.locations = [0, 1]
19+
$0.startPoint = CGPoint(x: 0.5, y: 0.5)
20+
$0.endPoint = CGPoint(x: 0.5, y: 1)
21+
}
22+
private lazy var patternImageView1 = UIImageView().then {
23+
$0.contentMode = .scaleAspectFit
24+
$0.image = STImages.homePattern1.image
25+
}
26+
private lazy var patternImageView2 = UIImageView().then {
27+
$0.contentMode = .scaleAspectFit
28+
$0.image = STImages.homePattern2.image
29+
}
30+
31+
override init(frame: CGRect) {
32+
super.init(frame: frame)
33+
setupUI()
34+
}
35+
36+
required init?(coder: NSCoder) {
37+
fatalError("init(coder:) has not been implemented")
38+
}
39+
40+
override func layoutSubviews() {
41+
super.layoutSubviews()
42+
gradientLayer.frame = bounds
43+
}
44+
45+
private func setupUI() {
46+
layer.insertSublayer(gradientLayer, at: .zero)
47+
48+
addSubview(patternImageView1)
49+
patternImageView1.snp.makeConstraints { make in
50+
make.top.equalToSuperview().offset(27)
51+
make.leading.equalToSuperview()
52+
}
53+
54+
addSubview(patternImageView2)
55+
patternImageView2.snp.makeConstraints { make in
56+
make.top.equalToSuperview().offset(155)
57+
make.trailing.equalToSuperview()
58+
}
59+
}
60+
}

Feature/Home/Sources/Home/HomeHeaderCollectionViewCell.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ final class HomeHeaderCollectionViewCell: UICollectionViewCell {
3535
$0.textColor = STColors.black.color
3636
}
3737
private lazy var imageView = UIImageView().then {
38-
$0.backgroundColor = .gray // TODO: 임시 영역
38+
$0.image = STImages.smilePig.image
39+
$0.contentMode = .scaleAspectFit
3940
}
4041

4142
override init(frame: CGRect) {

Feature/Home/Sources/Home/HomeService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct HomeService {
3333
if let recommendationContent = lottoRecommendation.content {
3434
HomeRecommendationCollectionViewCellModel(
3535
title: "\(name)님을 위한 로또 번호 추천",
36-
state: .needsResultCheck(numbers: [
36+
state: .recommended(numbers: [
3737
recommendationContent.num1,
3838
recommendationContent.num2,
3939
recommendationContent.num3,

Feature/Home/Sources/Home/HomeViewController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public final class HomeViewController: BaseViewController {
1919
private lazy var collectionView = UICollectionView(
2020
frame: .zero, collectionViewLayout: createLayout()
2121
).then {
22-
$0.backgroundColor = STColors.primary8.color // TODO: 확인 필요
22+
$0.backgroundView = HomeBackgroundView()
2323
$0.dataSource = self
2424
$0.register(
2525
HomeHeaderCollectionViewCell.self,
@@ -58,7 +58,9 @@ public final class HomeViewController: BaseViewController {
5858

5959
view.addSubview(collectionView)
6060
collectionView.snp.makeConstraints {
61-
$0.edges.equalToSuperview()
61+
$0.top.equalToSuperview()
62+
$0.horizontalEdges.equalToSuperview()
63+
$0.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
6264
}
6365
}
6466

0 commit comments

Comments
 (0)