Skip to content

Commit 23b33c4

Browse files
Minny27ibcylon
authored andcommitted
[#74]Feat: 마지막 더미 유저 Footer View 추가
- footer와 section의 제약조건 설정
1 parent ea9e4ba commit 23b33c4

File tree

2 files changed

+94
-1
lines changed

2 files changed

+94
-1
lines changed

Projects/Features/Falling/Src/Home/FallingHomeView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ extension NSCollectionLayoutSection {
7373
section.contentInsets = NSDirectionalEdgeInsets(
7474
top: 0,
7575
leading: 16,
76-
bottom: 0,
76+
bottom: 16,
7777
trailing: 16
7878
)
7979
section.interGroupSpacing = 14
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
//
2+
// DummyFooterView.swift
3+
// Falling
4+
//
5+
// Created by SeungMin on 5/26/24.
6+
//
7+
8+
import UIKit
9+
10+
import DSKit
11+
12+
final class DummyFooterView: UICollectionReusableView {
13+
private lazy var cardTimeView = CardTimeView()
14+
15+
override init(frame: CGRect) {
16+
super.init(frame: .zero)
17+
18+
configureUI()
19+
makeUI()
20+
}
21+
22+
required init?(coder: NSCoder) {
23+
fatalError("init(coder:) has not been implemented")
24+
}
25+
26+
private func configureUI() {
27+
layer.borderWidth = 1
28+
layer.cornerRadius = 20
29+
clipsToBounds = true
30+
// backgroundColor = .blue
31+
// layer.borderColor = UIColor.orange.cgColor
32+
33+
addGradientBackground()
34+
addGradientBorder()
35+
}
36+
37+
private func makeUI() {
38+
addSubview(cardTimeView)
39+
40+
cardTimeView.snp.makeConstraints {
41+
$0.top.leading.trailing.equalToSuperview().inset(12)
42+
$0.height.equalTo(32)
43+
}
44+
}
45+
46+
private func addGradientBackground() {
47+
let gradientLayer = CAGradientLayer()
48+
gradientLayer.frame = bounds
49+
50+
gradientLayer.colors = [
51+
DSKitAsset.Color.DummyUserGradient.backgroundFirst.color,
52+
DSKitAsset.Color.DummyUserGradient.backgroundSecond.color,
53+
DSKitAsset.Color.DummyUserGradient.backgroundFirst.color
54+
]
55+
56+
gradientLayer.locations = [0.0, 0.5, 1.0]
57+
58+
gradientLayer.startPoint = CGPoint(x: 0.5, y: 1.0)
59+
gradientLayer.endPoint = CGPoint(x: 0.5, y: 0.0)
60+
61+
// layer.addSublayer(gradientLayer)
62+
63+
layer.insertSublayer(gradientLayer, at: 0)
64+
}
65+
66+
private func addGradientBorder() {
67+
let gradientLayer = CAGradientLayer()
68+
gradientLayer.frame = bounds
69+
70+
gradientLayer.colors = [
71+
DSKitAsset.Color.DummyUserGradient.borderFirst.color,
72+
DSKitAsset.Color.DummyUserGradient.borderSecond.color
73+
]
74+
75+
// gradientLayer.locations = [0.0, 0.5, 1.0]
76+
77+
gradientLayer.startPoint = CGPoint(x: 0.5, y: 1.0)
78+
gradientLayer.endPoint = CGPoint(x: 0.5, y: 0.0)
79+
80+
let shapeLayer = CAShapeLayer()
81+
let path = UIBezierPath(roundedRect: bounds, cornerRadius: layer.cornerRadius)
82+
shapeLayer.path = path.cgPath
83+
shapeLayer.lineWidth = 1
84+
shapeLayer.fillColor = DSKitAsset.Color.LikeGradient.gradientFirst.color.cgColor
85+
shapeLayer.strokeColor = DSKitAsset.Color.LikeGradient.gradientFirst.color.cgColor
86+
87+
gradientLayer.mask = shapeLayer
88+
89+
// layer.addSublayer(gradientLayer)
90+
91+
layer.insertSublayer(gradientLayer, at: 0)
92+
}
93+
}

0 commit comments

Comments
 (0)