Skip to content

Commit de616de

Browse files
authored
[NL-86] : 1차 QA (#60)
* [NL-86] : home화면 reload 시점 갱신 * [NL-86] : fortune 사용자 정보 초기화 * [NL-86] : mypage 사용자 정보 초기화 시점 설정 - splashview layout 수정 * [NL-86] : Typography 자간 수정 * [NL-86] : onboarding + profileedit 화면 일부 로직 변경
1 parent bd2de5d commit de616de

File tree

15 files changed

+252
-118
lines changed

15 files changed

+252
-118
lines changed

Common/Auth/Sources/UserDataManager.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Base
99
import DIInjector
1010
import Foundation
1111
import NetworkCore
12+
import Combine
1213

1314
public final class UserDataManager {
1415

@@ -17,6 +18,7 @@ public final class UserDataManager {
1718
@Injected private var networkProvider: NetworkProvider
1819
public var user: UserDTO?
1920
public var userID: String { user?.id ?? deviceUUIDManager.deviceUUID }
21+
private let userPublisher: PassthroughSubject<Void, Never> = .init()
2022

2123
@discardableResult
2224
public func fetch() async throws -> UserDTO {
@@ -58,9 +60,15 @@ public final class UserDataManager {
5860
do {
5961
let user = try await networkProvider.request(target: target)
6062
self.user = user
63+
userPublisher.send(())
6164
return user
6265
} catch {
6366
throw error
6467
}
6568
}
69+
70+
public func getPublisher() -> AnyPublisher<Void, Never> {
71+
userPublisher
72+
.eraseToAnyPublisher()
73+
}
6674
}

DesignSystem/DesignSystem/Sources/Typography.swift

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,163 +14,163 @@ public struct Typography {
1414
public static var Display_28_B: Style {
1515
Style {
1616
$0.font = DesignSystemFontFamily.Suit.bold.font(size: 28)
17-
$0.kerning = .point(0.42)
17+
$0.kerning = .point(-0.42)
1818
}
1919
}
2020
public static var Display_26_B: Style {
2121
Style {
2222
$0.font = DesignSystemFontFamily.Suit.bold.font(size: 26)
23-
$0.kerning = .point(0.39)
23+
$0.kerning = .point(-0.39)
2424
}
2525
}
2626

2727
// MARK: - Heading
2828
public static var Heading_24_B: Style {
2929
Style {
3030
$0.font = DesignSystemFontFamily.Suit.bold.font(size: 24)
31-
$0.kerning = .point(0.36)
31+
$0.kerning = .point(-0.36)
3232
}
3333
}
3434
public static var Heading_24_SB: Style {
3535
Style {
3636
$0.font = DesignSystemFontFamily.Suit.semiBold.font(size: 24)
37-
$0.kerning = .point(0.36)
37+
$0.kerning = .point(-0.36)
3838
}
3939
}
4040
public static var Heading_22_B: Style {
4141
Style {
4242
$0.font = DesignSystemFontFamily.Suit.bold.font(size: 22)
43-
$0.kerning = .point(0.33)
43+
$0.kerning = .point(-0.33)
4444
}
4545
}
4646
public static var Heading_22_SB: Style {
4747
Style {
4848
$0.font = DesignSystemFontFamily.Suit.semiBold.font(size: 22)
49-
$0.kerning = .point(0.33)
49+
$0.kerning = .point(-0.33)
5050
}
5151
}
5252
public static var Heading_20_B: Style {
5353
Style {
5454
$0.font = DesignSystemFontFamily.Suit.bold.font(size: 20)
55-
$0.kerning = .point(0.3)
55+
$0.kerning = .point(-0.3)
5656
}
5757
}
5858
public static var Heading_20_SB: Style {
5959
Style {
6060
$0.font = DesignSystemFontFamily.Suit.semiBold.font(size: 20)
61-
$0.kerning = .point(0.3)
61+
$0.kerning = .point(-0.3)
6262
}
6363
}
6464
public static var Heading_20_M: Style {
6565
Style {
6666
$0.font = DesignSystemFontFamily.Suit.medium.font(size: 20)
67-
$0.kerning = .point(0.3)
67+
$0.kerning = .point(-0.3)
6868
}
6969
}
7070
public static var Heading_20_R: Style {
7171
Style {
7272
$0.font = DesignSystemFontFamily.Suit.regular.font(size: 20)
73-
$0.kerning = .point(0.3)
73+
$0.kerning = .point(-0.3)
7474
}
7575
}
7676

7777
// MARK: - Body
7878
public static var Body_18_B: Style {
7979
Style {
8080
$0.font = DesignSystemFontFamily.Suit.bold.font(size: 18)
81-
$0.kerning = .point(0.27)
81+
$0.kerning = .point(-0.27)
8282
}
8383
}
8484
public static var Body_18_SB: Style {
8585
Style {
8686
$0.font = DesignSystemFontFamily.Suit.semiBold.font(size: 18)
87-
$0.kerning = .point(0.27)
87+
$0.kerning = .point(-0.27)
8888
}
8989
}
9090
public static var Body_18_M: Style {
9191
Style {
9292
$0.font = DesignSystemFontFamily.Suit.medium.font(size: 18)
93-
$0.kerning = .point(0.27)
93+
$0.kerning = .point(-0.27)
9494
}
9595
}
9696
public static var Body_18_R: Style {
9797
Style {
9898
$0.font = DesignSystemFontFamily.Suit.regular.font(size: 18)
99-
$0.kerning = .point(0.27)
99+
$0.kerning = .point(-0.27)
100100
}
101101
}
102102
public static var Body_16_B: Style {
103103
Style {
104104
$0.font = DesignSystemFontFamily.Suit.bold.font(size: 16)
105-
$0.kerning = .point(0.24)
105+
$0.kerning = .point(-0.24)
106106
}
107107
}
108108
public static var Body_16_SB: Style {
109109
Style {
110110
$0.font = DesignSystemFontFamily.Suit.semiBold.font(size: 16)
111-
$0.kerning = .point(0.24)
111+
$0.kerning = .point(-0.24)
112112
}
113113
}
114114
public static var Body_16_M: Style {
115115
Style {
116116
$0.font = DesignSystemFontFamily.Suit.medium.font(size: 16)
117-
$0.kerning = .point(0.24)
117+
$0.kerning = .point(-0.24)
118118
}
119119
}
120120
public static var Body_16_R: Style {
121121
Style {
122122
$0.font = DesignSystemFontFamily.Suit.regular.font(size: 16)
123-
$0.kerning = .point(0.24)
123+
$0.kerning = .point(-0.24)
124124
}
125125
}
126126
public static var Body_14_B: Style {
127127
Style {
128128
$0.font = DesignSystemFontFamily.Suit.bold.font(size: 14)
129-
$0.kerning = .point(0.21)
129+
$0.kerning = .point(-0.21)
130130
}
131131
}
132132
public static var Body_14_SB: Style {
133133
Style {
134134
$0.font = DesignSystemFontFamily.Suit.semiBold.font(size: 14)
135-
$0.kerning = .point(0.21)
135+
$0.kerning = .point(-0.21)
136136
}
137137
}
138138
public static var Body_14_M: Style {
139139
Style {
140140
$0.font = DesignSystemFontFamily.Suit.medium.font(size: 14)
141-
$0.kerning = .point(0.21)
141+
$0.kerning = .point(-0.21)
142142
}
143143
}
144144
public static var Body_14_R: Style {
145145
Style {
146146
$0.font = DesignSystemFontFamily.Suit.regular.font(size: 14)
147-
$0.kerning = .point(0.21)
147+
$0.kerning = .point(-0.21)
148148
}
149149
}
150150

151151
// MARK: - Caption
152152
public static var Caption_12_B: Style {
153153
Style {
154154
$0.font = DesignSystemFontFamily.Suit.bold.font(size: 12)
155-
$0.kerning = .point(0.18)
155+
$0.kerning = .point(-0.18)
156156
}
157157
}
158158
public static var Caption_12_SB: Style {
159159
Style {
160160
$0.font = DesignSystemFontFamily.Suit.semiBold.font(size: 12)
161-
$0.kerning = .point(0.18)
161+
$0.kerning = .point(-0.18)
162162
}
163163
}
164164
public static var Caption_12_M: Style {
165165
Style {
166166
$0.font = DesignSystemFontFamily.Suit.medium.font(size: 12)
167-
$0.kerning = .point(0.18)
167+
$0.kerning = .point(-0.18)
168168
}
169169
}
170170
public static var Caption_12_R: Style {
171171
Style {
172172
$0.font = DesignSystemFontFamily.Suit.regular.font(size: 12)
173-
$0.kerning = .point(0.18)
173+
$0.kerning = .point(-0.18)
174174
}
175175
}
176176
}

Feature/Fortune/Sources/Cells/FortuneCollectionViewCell.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ final class FortuneCollectionViewCell: BaseCollectionViewCell {
7272
dayInfoLabel.snp.makeConstraints { make in
7373
make.top.equalToSuperview()
7474
make.centerX.equalToSuperview()
75+
make.height.equalTo(28)
7576
}
7677

7778
contentStackView.snp.makeConstraints { make in

Feature/Fortune/Sources/Cells/ThumbnailCollectionViewCell.swift

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ final class ThumbnailCollectionViewCell: BaseCollectionViewCell {
106106
private lazy var strengthStackView = UIStackView().then {
107107
$0.axis = .horizontal
108108
$0.distribution = .fill
109-
$0.spacing = 4
109+
$0.spacing = 12
110110
$0.backgroundColor = STColors.gray9.color
111111
$0.layer.cornerRadius = 6
112112
$0.isLayoutMarginsRelativeArrangement = true
@@ -192,6 +192,12 @@ final class ThumbnailCollectionViewCell: BaseCollectionViewCell {
192192
}
193193

194194
func update(with cellModel: ThumbnailCollectionViewCellModel) {
195+
juLabelStackView.removeAllArrangedSubviews()
196+
jeLabelStackView.removeAllArrangedSubviews()
197+
juStackView.removeAllArrangedSubviews()
198+
jeStackView.removeAllArrangedSubviews()
199+
strengthStackView.removeAllArrangedSubviews()
200+
195201
nicknameLabel.styledText = cellModel.name
196202
birthDateLabel.styledText = cellModel.birthDate
197203
bornTimeLabel.styledText = cellModel.birthTime
@@ -219,7 +225,7 @@ final class ThumbnailCollectionViewCell: BaseCollectionViewCell {
219225
}
220226

221227
separatorView.snp.makeConstraints { make in
222-
make.height.equalTo(24)
228+
make.height.equalTo(28)
223229
make.width.equalTo(1)
224230
}
225231
strengthStackView.addArrangedSubview(strongStack)
@@ -395,14 +401,28 @@ extension ThumbnailCollectionViewCell {
395401
$0.layer.borderColor = element?.color.cgColor
396402
$0.textAlignment = .center
397403
$0.clipsToBounds = true
398-
$0.layer.cornerRadius = 13
404+
$0.layer.cornerRadius = 14
399405
$0.styledText = "\(element?.kor ?? "-") \(info)"
400406
$0.contentInsets = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10)
401407
}
402408

403409
stackView.addArrangedSubview(typeLabel)
404410
stackView.addArrangedSubview(infoLabel)
411+
412+
infoLabel.snp.makeConstraints { make in
413+
make.height.equalTo(28)
414+
}
405415

406416
return stackView
407417
}
408418
}
419+
420+
extension UIStackView {
421+
func removeAllArrangedSubviews() {
422+
let removedSubviews = arrangedSubviews
423+
removedSubviews.forEach {
424+
removeArrangedSubview($0)
425+
$0.removeFromSuperview()
426+
}
427+
}
428+
}

Feature/Fortune/Sources/Concreate/FiveElements.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ enum FiveElements {
3131
var kor: String {
3232
switch self {
3333
case .wood:
34-
return "(木)"
34+
return ""
3535
case .fire:
36-
return "(火)"
36+
return ""
3737
case .earth:
38-
return "(土)"
38+
return ""
3939
case .metal:
40-
return "(金)"
40+
return ""
4141
case .water:
42-
return "(水)"
42+
return ""
4343
case .null:
4444
return "-"
4545
}

Feature/Fortune/Sources/FortuneViewController.swift

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ extension FortuneViewController {
107107
spacing = 32
108108
case .thumbnail:
109109
itemHeight = .fractionalHeight(1.0)
110-
groupHeight = .estimated(518)
110+
groupHeight = .estimated(525)
111111
spacing = 32
112112
case .moreInfo:
113113
itemHeight = .fractionalHeight(1.0)
@@ -145,16 +145,14 @@ extension FortuneViewController {
145145
// MARK: SetupFunc
146146
extension FortuneViewController {
147147
private func setupHierarchy() {
148-
149-
}
150-
151-
private func setupUI() {
152-
self.view.backgroundColor = STColors.primary9.color
153-
154148
self.view.addSubview(separteLine)
155149
self.view.addSubview(backgroundView)
156150
self.view.addSubview(ellips)
157151
self.view.addSubview(collectionView)
152+
}
153+
154+
private func setupUI() {
155+
self.view.backgroundColor = STColors.primary9.color
158156

159157
ellips.snp.makeConstraints { make in
160158
make.top.trailing.equalToSuperview()
@@ -187,6 +185,18 @@ extension FortuneViewController {
187185
self.collectionView.reloadData()
188186
}
189187
.store(in: &store)
188+
189+
viewModel.output.isLoading
190+
.receive(on: DispatchQueue.main)
191+
.sink { [weak self] isLoading in
192+
guard let self else { return }
193+
if isLoading {
194+
self.showLoading()
195+
} else {
196+
self.hideLoading()
197+
}
198+
}
199+
.store(in: &store)
190200
}
191201
}
192202

0 commit comments

Comments
 (0)