Skip to content

Commit 1365a67

Browse files
authored
Merge pull request #38 from kut7728/fix/#37
[FIX] Fix UI, Colors and delete Network.swift
2 parents 1ce45c8 + b3a54ff commit 1365a67

File tree

12 files changed

+224
-139
lines changed

12 files changed

+224
-139
lines changed

Pinit/Pinit/DesignSystem/DesignSystem.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,25 @@ import UIKit
99

1010
enum DesignSystemColor {
1111
case Purple
12+
case Purple50
1213
case Lavender
14+
case Lavender10
15+
case Lavender1
1316
}
1417
extension DesignSystemColor {
1518
var value: UIColor {
1619
switch self {
1720
case .Purple:
1821
UIColor(hex: "#561CE2")
22+
case .Purple50:
23+
UIColor(hex: "#8562D5")
1924
case .Lavender:
2025
UIColor(hex: "#6450E2")
21-
26+
case .Lavender10:
27+
UIColor(hex: "#C2BFD2")
28+
case .Lavender1:
29+
UIColor(hex: "#CECCCF")
30+
2231
}
2332
}
2433
}

Pinit/Pinit/Repository/Moya/Network.swift

Lines changed: 0 additions & 12 deletions
This file was deleted.

Pinit/Pinit/Views/Cells/PinRecordCell.swift

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ final class PinRecordCell: UICollectionViewCell {
2121
}()
2222
public lazy var thumbnailImageView: UIImageView = {
2323
let imageView = UIImageView()
24-
imageView.contentMode = .scaleToFill
24+
imageView.contentMode = .scaleAspectFill
2525
imageView.backgroundColor = .lightGray
26+
imageView.clipsToBounds = true
2627
return imageView
2728
}()
2829
private lazy var pinTitleLabel: UILabel = {
@@ -98,19 +99,19 @@ final class PinRecordCell: UICollectionViewCell {
9899
extension PinRecordCell {
99100
func captureMapSnapshotWithPin(center: CLLocationCoordinate2D, imageSize: CGSize, completion: @escaping (UIImage?) -> Void) {
100101
let options = MKMapSnapshotter.Options()
101-
options.region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 0.003, longitudeDelta: 0.003))
102-
options.size = imageSize
103-
options.mapType = .standard
104-
105-
let snapshotter = MKMapSnapshotter(options: options)
106-
snapshotter.start { snapshot, error in
107-
guard let snapshot = snapshot, error == nil else {
108-
print("스냅샷 생성 실패")
109-
completion(nil)
110-
return
111-
}
112-
113-
completion(snapshot.image)
102+
options.region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 0.003, longitudeDelta: 0.003))
103+
options.size = imageSize
104+
options.mapType = .standard
105+
106+
let snapshotter = MKMapSnapshotter(options: options)
107+
snapshotter.start { snapshot, error in
108+
guard let snapshot = snapshot, error == nil else {
109+
print("스냅샷 생성 실패")
110+
completion(nil)
111+
return
114112
}
113+
114+
completion(snapshot.image)
115+
}
115116
}
116117
}

Pinit/Pinit/Views/Cells/ReviewCell.swift

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@ import SnapKit
1010

1111
class ReviewCell: UITableViewCell {
1212

13-
// MARK: - init
14-
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
15-
super.init(style: style, reuseIdentifier: reuseIdentifier)
16-
17-
addComponents()
18-
}
19-
20-
required init?(coder: NSCoder) {
21-
fatalError("init(coder:) has not been implemented")
22-
}
23-
2413
// MARK: - 컴포넌트 설정
2514
public lazy var reviewCellPanel: UIView = {
2615
let view = UIView()
@@ -31,7 +20,7 @@ class ReviewCell: UITableViewCell {
3120
public lazy var reviewDate: UILabel = {
3221
let label = UILabel()
3322
label.text = "25년 3월 3일"
34-
label.font = DesignSystemFont.Pretendard_SemiBold16.value
23+
label.font = DesignSystemFont.Pretendard_Bold16.value
3524
return label
3625
}()
3726

@@ -49,31 +38,54 @@ class ReviewCell: UITableViewCell {
4938
return button
5039
}()
5140

41+
// MARK: - init
42+
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
43+
super.init(style: style, reuseIdentifier: reuseIdentifier)
44+
addComponents()
45+
}
46+
47+
required init?(coder: NSCoder) {
48+
fatalError("init(coder:) has not been implemented")
49+
}
50+
51+
override func layoutSubviews() {
52+
super.layoutSubviews()
53+
54+
contentView.frame = contentView.frame.inset(by: UIEdgeInsets(top: 4, left: 0, bottom: 2, right: 0))
55+
}
56+
57+
58+
override func setSelected(_ selected: Bool, animated: Bool) {
59+
super.setSelected(selected, animated: animated)
60+
61+
if selected {
62+
contentView.layer.shadowOffset = CGSize(width: 10, height: 10)
63+
contentView.layer.shadowColor = DesignSystemColor.Purple.value.cgColor
64+
}else{
65+
contentView.layer.shadowOffset = CGSize(width: 10, height: 10)
66+
contentView.layer.shadowColor = DesignSystemColor.Purple.value.cgColor
67+
}
68+
}
5269

5370

5471
// MARK: - 데이터 설정 메서드
5572
func configure(date: String, desc: String) {
5673
reviewDate.text = date
5774
reviewText.text = desc
5875
}
59-
60-
61-
62-
6376
// MARK: - 레이아웃
6477
private func addComponents() {
78+
6579
self.addSubviews(reviewCellPanel)
6680
reviewCellPanel.addSubviews(reviewDate, reviewText, reviewMenuButton)
6781

6882

69-
reviewCellPanel.snp.makeConstraints {
70-
$0.width.equalToSuperview()
71-
$0.height.equalTo(60)
72-
$0.centerY.equalToSuperview()
83+
reviewCellPanel.snp.makeConstraints{
84+
$0.edges.equalToSuperview()
7385
}
7486

7587
reviewDate.snp.makeConstraints {
76-
$0.top.equalToSuperview()
88+
$0.top.equalToSuperview().inset(10)
7789
$0.leading.equalToSuperview().inset(10)
7890
}
7991

@@ -82,10 +94,10 @@ class ReviewCell: UITableViewCell {
8294
$0.leading.equalToSuperview().inset(10)
8395
}
8496

85-
reviewMenuButton.snp.makeConstraints {
86-
$0.top.equalToSuperview()
87-
$0.trailing.equalToSuperview().inset(10)
88-
}
97+
// reviewMenuButton.snp.makeConstraints {
98+
// $0.top.equalToSuperview()
99+
// $0.trailing.equalToSuperview().inset(10)
100+
// }
89101

90102
}
91103

Pinit/Pinit/Views/Home/HomeViewController.swift

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ class HomeViewController: UIViewController {
2121
private var adapter: PinCollectionViewAdapter?
2222
private let mapView = MKMapView(frame: .zero)
2323
private let bottomSheet = CustomBottomSheet()
24+
2425
private lazy var addPinButton: UIButton = {
2526
let button = UIButton()
26-
let image = UIImage(systemName: "pencil.line")
2727
button.setImage(UIImage(systemName: "pencil.line"), for: .normal)
28-
button.backgroundColor = .secondarySystemBackground
29-
button.tintColor = DesignSystemColor.Purple.value
28+
button.backgroundColor = DesignSystemColor.Lavender.value
29+
button.tintColor = .white
3030
button.layer.cornerRadius = circleButtonSize / 2
3131
button.clipsToBounds = true
3232
return button
3333
}()
3434
private lazy var currentLocationButton: UIButton = {
3535
let button = UIButton()
3636
button.setImage(UIImage(systemName: "dot.scope"), for: .normal)
37-
button.backgroundColor = .secondarySystemBackground
38-
button.tintColor = DesignSystemColor.Purple.value
37+
button.backgroundColor = DesignSystemColor.Lavender.value
38+
button.tintColor = .white
3939
button.layer.cornerRadius = circleButtonSize / 2
4040
button.clipsToBounds = true
4141
return button
@@ -67,7 +67,8 @@ class HomeViewController: UIViewController {
6767
mapView.delegate = self
6868

6969
mapView.showsUserLocation = true
70-
mapView.setCameraZoomRange(.init(minCenterCoordinateDistance: 333, maxCenterCoordinateDistance: 5000), animated: true)
70+
#warning("setCameraZoomRange 주석")
71+
// mapView.setCameraZoomRange(.init(minCenterCoordinateDistance: 333, maxCenterCoordinateDistance: 5000), animated: true)
7172
// Location 불러오기 전 기본값 설정
7273
var currentLocation = CLLocationCoordinate2D(
7374
latitude: 37.277252,
@@ -298,7 +299,9 @@ extension HomeViewController {
298299
bottomSheetHeight = large
299300
bottomSheet.collectionView.isUserInteractionEnabled = true
300301
}
301-
else if newHeight > (view.frame.height * 0.3) {
302+
303+
else if newHeight > (view.frame.height * 0.25) {
304+
#warning("0.3 -> 0.25")
302305
bottomSheetHeight = medium
303306
bottomSheet.collectionView.isUserInteractionEnabled = true
304307
}

Pinit/Pinit/Views/Home/SubViews/CustomBottomSheet.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class CustomBottomSheet: UIView {
1313
let grabber: UIView = {
1414
let grabber = UIView()
1515
grabber.layer.cornerRadius = 4
16-
grabber.backgroundColor = DesignSystemColor.Purple.value
16+
grabber.backgroundColor = DesignSystemColor.Lavender.value
1717
grabber.layer.borderColor = UIColor.white.cgColor
1818
grabber.layer.borderWidth = 1
1919
grabber.clipsToBounds = true
@@ -33,6 +33,7 @@ final class CustomBottomSheet: UIView {
3333
func setupLayout() {
3434
let cornerRadius = 20.0
3535
self.backgroundColor = .secondarySystemBackground
36+
// self.backgroundColor = DesignSystemColor.Lavender1.value
3637
self.layer.cornerRadius = cornerRadius
3738
// cornerRadius 상단 좌,우측만 적용하기
3839
self.layer.maskedCorners = .init(arrayLiteral: [.layerMaxXMinYCorner, .layerMinXMinYCorner])

Pinit/Pinit/Views/PastPin/PastPinViewController.swift

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ final class PastPinViewController: UIViewController {
9595

9696
PinCalendar.backgroundColor = .white
9797
PinCalendar.layer.cornerRadius = 10
98+
PinCalendar.layer.borderColor = DesignSystemColor.Lavender10.value.cgColor
99+
PinCalendar.layer.borderWidth = 2
98100
PinCalendar.locale = Locale.init(identifier: "ko_KR")
99101
PinCalendar.firstWeekday = 1
100102
PinCalendar.appearance.headerDateFormat = "YYYY년 MM월"
@@ -103,16 +105,18 @@ final class PastPinViewController: UIViewController {
103105

104106
//년월 폰트
105107
PinCalendar.appearance.headerTitleFont = DesignSystemFont.Pretendard_Bold20.value
106-
PinCalendar.appearance.headerTitleColor = .black
108+
PinCalendar.appearance.headerTitleColor = DesignSystemColor.Purple.value
107109
//요일 폰트
108-
PinCalendar.appearance.weekdayFont = DesignSystemFont.Pretendard_Bold12.value
110+
PinCalendar.appearance.weekdayFont = DesignSystemFont.Pretendard_Medium16.value
109111
PinCalendar.appearance.weekdayTextColor = .black
110112
//날짜 폰트
111-
PinCalendar.appearance.titleFont = DesignSystemFont.Pretendard_Medium12.value
113+
PinCalendar.appearance.titleFont = DesignSystemFont.Pretendard_Medium14.value
112114
//오늘
113-
PinCalendar.appearance.todayColor = .systemGray3
115+
PinCalendar.appearance.todayColor = DesignSystemColor.Lavender10.value
116+
PinCalendar.appearance.todaySelectionColor = DesignSystemColor.Purple50.value
117+
114118
//오늘 아님
115-
PinCalendar.appearance.selectionColor = .systemBlue
119+
PinCalendar.appearance.selectionColor = DesignSystemColor.Purple50.value
116120
}
117121
}
118122

@@ -128,18 +132,18 @@ extension PastPinViewController : FSCalendarDelegate, FSCalendarDataSource, FSCa
128132

129133
}
130134

131-
//해당 pinEntity안에 데이터의 유무에 따라 해당 날짜에 dot이 노출댑니당>.<
132-
func calendar(_ calendar: FSCalendar, numberOfEventsFor date: Date) -> Int {
133-
return pinData.contains { Calendar.current.isDate($0.date, inSameDayAs: date) } ? 1 : 0
134-
}
135+
// //해당 pinEntity안에 데이터의 유무에 따라 해당 날짜에 dot이 노출댑니당>.<
136+
// func calendar(_ calendar: FSCalendar, numberOfEventsFor date: Date) -> Int {
137+
// return pinData.contains { Calendar.current.isDate($0.date, inSameDayAs: date) } ? 1 : 0
138+
// }
135139

136140
func calendar(_ calendar: FSCalendar, appearance: FSCalendarAppearance, titleDefaultColorFor date: Date) -> UIColor? {
137141
let day = Calendar.current.component(.weekday, from: date) - 1
138142

139143
if Calendar.current.shortWeekdaySymbols[day] == "Sun" || Calendar.current.shortWeekdaySymbols[day] == "" {
140144
return .systemRed //일요일 색
141145
} else if Calendar.current.shortWeekdaySymbols[day] == "Sat" || Calendar.current.shortWeekdaySymbols[day] == "" {
142-
return .systemBlue //토요일 색
146+
return DesignSystemColor.Purple.value //토요일 색
143147
} else {
144148
return .label //기본색
145149
}

0 commit comments

Comments
 (0)