From 23ff307203dbf3c87e24b1cf627edc7adb372ad5 Mon Sep 17 00:00:00 2001 From: isGeekCode Date: Sun, 28 Jan 2024 23:00:17 +0900 Subject: [PATCH] =?UTF-8?q?:recycle:=20=EB=AC=B8=EC=9E=90=EC=97=B4=20?= =?UTF-8?q?=EB=B3=80=EC=88=98=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/Localizable.xcstrings | 9 -------- .../OnboardingScene/OnboardingView.swift | 22 +++++++++++++++---- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/PyeonHaeng-iOS/Resources/Localizable.xcstrings b/PyeonHaeng-iOS/Resources/Localizable.xcstrings index 3699a9f..9d18f22 100644 --- a/PyeonHaeng-iOS/Resources/Localizable.xcstrings +++ b/PyeonHaeng-iOS/Resources/Localizable.xcstrings @@ -3,15 +3,6 @@ "strings" : { "" : { - }, - "건너뛰기" : { - - }, - "다음" : { - - }, - "편행 시작하기" : { - } }, "version" : "1.0" diff --git a/PyeonHaeng-iOS/Sources/Scenes/OnboardingScene/OnboardingView.swift b/PyeonHaeng-iOS/Sources/Scenes/OnboardingScene/OnboardingView.swift index d31e0f2..a2c1ec4 100644 --- a/PyeonHaeng-iOS/Sources/Scenes/OnboardingScene/OnboardingView.swift +++ b/PyeonHaeng-iOS/Sources/Scenes/OnboardingScene/OnboardingView.swift @@ -47,6 +47,20 @@ private enum OnboardingPage: Int, CaseIterable { struct OnboardingView: View { @State private var currentPage = 0 + private var currentTitle: String { + OnboardingPage(rawValue: currentPage)?.title ?? "" + } + + private var currentBody: String { + OnboardingPage(rawValue: currentPage)?.body ?? "" + } + + private var nextBtnText: String { + currentPage < OnboardingPage.allCases.count - 1 ? "다음" : "편행 시작하기" + } + + private var skipBtnText: String = "건너뛰기" + var body: some View { NavigationStack { VStack { @@ -71,12 +85,12 @@ struct OnboardingView: View { .padding(.vertical) // 본문 제목 - Text(OnboardingPage(rawValue: currentPage)?.title ?? "") + Text(currentTitle) .font(.h2) Spacer().frame(height: 16) // 본문 내용 - Text(OnboardingPage(rawValue: currentPage)?.body ?? "") + Text(currentBody) .font(.body2) .foregroundStyle(Color.gray500) .multilineTextAlignment(.center) @@ -89,7 +103,7 @@ struct OnboardingView: View { currentPage += 1 } }) { - Text(currentPage < OnboardingPage.allCases.count - 1 ? "다음" : "편행 시작하기") + Text(nextBtnText) .foregroundColor(.white) .frame(maxWidth: .infinity) .padding() @@ -102,7 +116,7 @@ struct OnboardingView: View { .navigationTitle("") .toolbar { ToolbarItem(placement: .navigationBarTrailing) { - Button("건너뛰기") { + Button(skipBtnText) { // 건너뛰기 버튼 액션 } .foregroundStyle(Color.green500)