Skip to content

Commit cec9be8

Browse files
authored
fix: 온보딩 선택 결과 화면 수정
* fix: 4회 이상 외출 결과 layout 추가 및 수정 * fix: 온보딩 결과 화면 사각형 크기 선택지에 따라 다르게 설정
1 parent 307b8c9 commit cec9be8

File tree

7 files changed

+78
-15
lines changed

7 files changed

+78
-15
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "rounded_max_rectangle.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "rounded_max_rectangle@2x.png",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"filename" : "rounded_max_rectangle@3x.png",
15+
"idiom" : "universal",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"author" : "xcode",
21+
"version" : 1
22+
}
23+
}
9.6 KB
Loading
20.6 KB
Loading
31.6 KB
Loading

Projects/Presentation/Sources/Common/DesignSystem/BitnagilGraphic.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ enum BitnagilGraphic {
1818
static let loginGraphic = UIImage(named: "login_graphic", in: bundle, with: nil)
1919
static let onboardingRectangle = UIImage(named: "rounded_rectangle", in: bundle, with: nil)
2020
static let onboardingBigRectangle = UIImage(named: "rounded_big_rectangle", in: bundle, with: nil)
21+
static let onboardingMaxRectangle = UIImage(named: "rounded_max_rectangle", in: bundle, with: nil)
2122
static let onboardingFomoGraphic = UIImage(named: "onboarding_fomo_graphic", in: bundle, with: nil)
2223
static let onboardingGrayLine = UIImage(named: "gray_line", in: bundle, with: nil)
2324
static let progressStep1 = UIImage(named: "progress_step1", in: bundle, with: nil)

Projects/Presentation/Sources/Onboarding/View/Component/OnboardingResultSummaryView.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,18 @@ final class OnboardingResultSummaryView: UIView {
8585
}
8686

8787
case .outdoor:
88-
return "\(highlightText)을 목표로 해볼게요!"
88+
if highlightText.contains("4") {
89+
return "\(highlightText)을 목표로"
90+
} else {
91+
return "\(highlightText)을 목표로 해볼게요!"
92+
}
8993

9094
default:
91-
return "원하는 중이에요"
95+
if highlightText == "" {
96+
return "원하는 중이에요"
97+
} else {
98+
return "해볼게요!"
99+
}
92100
}
93101
}
94102

Projects/Presentation/Sources/Onboarding/View/OnboardingResultViewController.swift

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ final class OnboardingResultViewController: BaseViewController<OnboardingViewMod
3030
static let rectangleImageViewTopSpacing: CGFloat = 1.5
3131
static let rectangleImageViewWidth: CGFloat = 310
3232
static let rectangleImageViewHeight: CGFloat = 220
33-
static let rectangleImageViewMaxHeight: CGFloat = 260
33+
static let rectangleImageViewMidHeight: CGFloat = 260
34+
static let rectangleImageViewMaxHeight: CGFloat = 290
3435
static let nameLabelTopSpacing: CGFloat = 30
3536
static let nameLabelLeadingSpacing: CGFloat = 30
3637
static let nameLabelHeight: CGFloat = 25.76
@@ -96,8 +97,8 @@ final class OnboardingResultViewController: BaseViewController<OnboardingViewMod
9697
private func updateMainLabelTopSpacing() {
9798
let height = view.bounds.height
9899
let spacing: CGFloat = height <= 667 ? Layout.mainLabelMinTopSpacing : Layout.mainLabelMaxTopSpacing
99-
100100
mainLabelTopConstraint?.update(offset: spacing)
101+
resultGraphicViewTopConstraint?.update(offset: Layout.resultGraphicViewTopMinSpacing)
101102
}
102103

103104
override func configureAttribute() {
@@ -238,38 +239,67 @@ final class OnboardingResultViewController: BaseViewController<OnboardingViewMod
238239
}
239240

240241
let timeResultView = OnboardingResultSummaryView(onboardingType: .time, highlightText: timeResult)
242+
let feelingResultView = OnboardingResultSummaryView(onboardingType: .feeling, highlightText: feelingResult)
241243
let outdoorResultView = OnboardingResultSummaryView(onboardingType: .outdoor, highlightText: outdoorResult)
244+
[timeResultView, feelingResultView, outdoorResultView].forEach {
245+
$0.snp.makeConstraints { make in
246+
make.height.equalTo(Layout.resultLabelHeight)
247+
}
248+
}
242249

243250
let feelingResultStackView = UIStackView()
244251
feelingResultStackView.axis = .vertical
245252
feelingResultStackView.spacing = 6
246253

247-
let feelingResultView = OnboardingResultSummaryView(onboardingType: .feeling, highlightText: feelingResult)
254+
// expand feeling result view
248255
feelingResultStackView.addArrangedSubview(feelingResultView)
249-
250256
let ifNeedExpandFeelingResult = feelingResult.filter({ $0 == "," }).count >= 2
251257
if ifNeedExpandFeelingResult {
252-
let extendtedFeelingResultView = OnboardingResultSummaryView(onboardingType: nil, highlightText: "")
253-
feelingResultStackView.addArrangedSubview(extendtedFeelingResultView)
254-
extendtedFeelingResultView.snp.makeConstraints { make in
258+
let expandedFeelingResultView = OnboardingResultSummaryView(onboardingType: nil, highlightText: "")
259+
feelingResultStackView.addArrangedSubview(expandedFeelingResultView)
260+
expandedFeelingResultView.snp.makeConstraints { make in
255261
make.height.equalTo(Layout.resultLabelHeight)
256262
}
257-
rectangleImageView.image = BitnagilGraphic.onboardingBigRectangle
258-
rectangleHeightConstraint?.update(offset: Layout.rectangleImageViewMaxHeight)
259-
resultGraphicViewTopConstraint?.update(offset: Layout.resultGraphicViewTopMinSpacing)
260263
}
261264

262265
feelingResultStackView.snp.makeConstraints { make in
263266
make.height.equalTo(ifNeedExpandFeelingResult ? Layout.resultLabelMaxHeight : Layout.resultLabelHeight)
264267
}
265268

266-
[timeResultView, feelingResultView, outdoorResultView].forEach {
267-
$0.snp.makeConstraints { make in
269+
// expand outdoor result view
270+
let outdoorResultStackView = UIStackView()
271+
outdoorResultStackView.axis = .vertical
272+
outdoorResultStackView.spacing = 6
273+
274+
outdoorResultStackView.addArrangedSubview(outdoorResultView)
275+
let ifNeedExpandOutdoorResult = outdoorResult.contains("4")
276+
if ifNeedExpandOutdoorResult {
277+
let expandedOutdoorResultView = OnboardingResultSummaryView(onboardingType: nil, highlightText: " ")
278+
outdoorResultStackView.addArrangedSubview(expandedOutdoorResultView)
279+
expandedOutdoorResultView.snp.makeConstraints { make in
268280
make.height.equalTo(Layout.resultLabelHeight)
269281
}
270282
}
271283

272-
[timeResultView, feelingResultStackView, outdoorResultView].forEach {
284+
outdoorResultStackView.snp.makeConstraints { make in
285+
make.height.equalTo(ifNeedExpandOutdoorResult ? Layout.resultLabelMaxHeight : Layout.resultLabelHeight)
286+
}
287+
288+
if ifNeedExpandFeelingResult && ifNeedExpandOutdoorResult {
289+
rectangleImageView.image = BitnagilGraphic.onboardingMaxRectangle
290+
rectangleHeightConstraint?.update(offset: Layout.rectangleImageViewMaxHeight)
291+
resultGraphicViewTopConstraint?.update(offset: Layout.resultGraphicViewTopMinSpacing)
292+
} else if ifNeedExpandFeelingResult != ifNeedExpandOutdoorResult {
293+
rectangleImageView.image = BitnagilGraphic.onboardingBigRectangle
294+
rectangleHeightConstraint?.update(offset: Layout.rectangleImageViewMidHeight)
295+
resultGraphicViewTopConstraint?.update(offset: Layout.resultGraphicViewTopMinSpacing)
296+
} else {
297+
rectangleImageView.image = BitnagilGraphic.onboardingRectangle
298+
rectangleHeightConstraint?.update(offset: Layout.rectangleImageViewHeight)
299+
resultGraphicViewTopConstraint?.update(offset: Layout.resultGraphicViewTopSpacing)
300+
}
301+
302+
[timeResultView, feelingResultStackView, outdoorResultStackView].forEach {
273303
resultStackView.addArrangedSubview($0)
274304
}
275305
}
@@ -296,6 +326,7 @@ final class OnboardingResultViewController: BaseViewController<OnboardingViewMod
296326
}
297327

298328
guard let nextView else { return }
329+
nextView.hidesBottomBarWhenPushed = true
299330
self.navigationController?.pushViewController(nextView, animated: true)
300331
}
301332
}

0 commit comments

Comments
 (0)