@@ -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