Skip to content

Commit 3fe2fd6

Browse files
committed
๐Ÿ’„ [style] ๋‚ด ํ•ํ”„ํ‹ฐ ๋“ฑ๋ก์— ๊ฒฝ๊ณ ๋ฌธ๊ตฌ ์ถ”๊ฐ€
- info ์ด๋ฏธ์ง€ ์ถ”๊ฐ€
1 parent ff2615d commit 3fe2fd6

File tree

4 files changed

+93
-1
lines changed

4 files changed

+93
-1
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" : "info.svg",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Lines changed: 3 additions & 0 deletions
Loading

โ€ŽFitfty/Projects/MainFeed/Sources/MyFitfty/ViewControllers/MyFitftyViewController.swiftโ€Ž

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ final public class MyFitftyViewController: UIViewController {
3030
collectionView.register(GenderCell.self)
3131
collectionView.register(Common.HeaderView.self, forSupplementaryViewOfKind: Common.HeaderView.className)
3232
collectionView.register(FooterView.self, forSupplementaryViewOfKind: FooterView.className)
33+
collectionView.register(WarningView.self, forSupplementaryViewOfKind: WarningView.className)
3334
collectionView.delegate = self
3435
return collectionView
3536
}()
@@ -371,6 +372,13 @@ extension MyFitftyViewController {
371372
for: indexPath
372373
)
373374

375+
case WarningView.className:
376+
return collectionView.dequeueReusableSupplementaryView(
377+
ofKind: elementKind,
378+
withReuseIdentifier: WarningView.className,
379+
for: indexPath
380+
)
381+
374382
default:
375383
return UICollectionReusableView()
376384
}
@@ -454,10 +462,19 @@ extension MyFitftyViewController {
454462
)
455463

456464
let section = NSCollectionLayoutSection(group: group)
457-
section.contentInsets = .init(top: 20, leading: 20, bottom: 20, trailing: 20)
465+
section.contentInsets = .init(top: 20, leading: 20, bottom: 80, trailing: 20)
458466

459467
section.interGroupSpacing = 8
460468
section.orthogonalScrollingBehavior = .continuous
469+
470+
section.boundarySupplementaryItems = [
471+
NSCollectionLayoutBoundarySupplementaryItem(
472+
layoutSize: .init(
473+
widthDimension: .absolute(view.safeAreaLayoutGuide.layoutFrame.width-40),
474+
heightDimension: .estimated(54)
475+
),
476+
elementKind: WarningView.className, alignment: .bottom)
477+
]
461478
return section
462479
}
463480

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//
2+
// WarningView.swift
3+
// MainFeed
4+
//
5+
// Created by ์ž„์˜์„  on 2023/02/20.
6+
// Copyright ยฉ 2023 Fitfty. All rights reserved.
7+
//
8+
9+
import UIKit
10+
import Common
11+
12+
final class WarningView: UICollectionReusableView {
13+
14+
private lazy var warningLabel: UILabel = {
15+
let label = UILabel()
16+
label.text = "์ฝ”๋””์™€ ๊ด€๋ จ๋œ ์‚ฌ์ง„์„ ์˜ฌ๋ ธ๋Š”์ง€ ํ™•์ธํ•ด ์ฃผ์„ธ์š”. ์ฝ”๋””์™€ ๊ด€๋ จ ์—†๋Š” ์ฝ˜ํ…์ธ ๋Š” ๋ณ„๋„ ๊ณ ์ง€ ์—†์ด ๋‚ด๋ถ€ ๊ทœ์ •์— ๋”ฐ๋ผ ์ œ์žฌ๋  ์ˆ˜ ์žˆ์–ด์š”."
17+
label.textColor = CommonAsset.Colors.gray04.color
18+
label.font = FitftyFont.appleSDSemiBold(size: 12).font
19+
label.numberOfLines = 0
20+
label.lineBreakMode = .byCharWrapping
21+
label.setTextWithLineHeight(lineHeight: 16.8)
22+
return label
23+
}()
24+
25+
private lazy var infoImageView: UIImageView = {
26+
let imageView = UIImageView()
27+
imageView.image = CommonAsset.Images.info.image
28+
return imageView
29+
}()
30+
31+
override init(frame: CGRect) {
32+
super.init(frame: frame)
33+
setView()
34+
setConstraintsLayout()
35+
}
36+
37+
required init?(coder: NSCoder) {
38+
fatalError("init(coder:) has not been implemented")
39+
}
40+
41+
private func setConstraintsLayout() {
42+
addSubviews(infoImageView, warningLabel)
43+
NSLayoutConstraint.activate([
44+
infoImageView.widthAnchor.constraint(equalToConstant: 11.67),
45+
infoImageView.heightAnchor.constraint(equalToConstant: 11.67),
46+
infoImageView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 11),
47+
infoImageView.topAnchor.constraint(equalTo: topAnchor, constant: 11),
48+
warningLabel.leadingAnchor.constraint(equalTo: infoImageView.trailingAnchor, constant: 3),
49+
warningLabel.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -10),
50+
warningLabel.topAnchor.constraint(equalTo: topAnchor, constant: 10),
51+
warningLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -10)
52+
])
53+
}
54+
55+
private func setView() {
56+
self.layer.borderColor = CommonAsset.Colors.gray02.color.cgColor
57+
self.layer.borderWidth = 1
58+
self.layer.cornerRadius = 4
59+
}
60+
}

0 commit comments

Comments
ย (0)