From e6f8bde72685c796304662ee21ff4acd98b9eb61 Mon Sep 17 00:00:00 2001 From: vinkwok Date: Sat, 1 Jul 2023 13:44:23 +0800 Subject: [PATCH] fix(onboarding): move attributed title declaration out of view body --- .../xcshareddata/swiftpm/Package.resolved | 2 +- Swiftcord/Views/OnboardingView.swift | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Swiftcord.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Swiftcord.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 24b4fa1e..9998b1ac 100644 --- a/Swiftcord.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Swiftcord.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -24,7 +24,7 @@ "location" : "https://github.com/SwiftcordApp/DiscordKit", "state" : { "branch" : "main", - "revision" : "1ebdca903f96966fb54ac41a2b1d04b0f5845a9b" + "revision" : "1474f71dabb18050cc2422d08643731b7aecf6a4" } }, { diff --git a/Swiftcord/Views/OnboardingView.swift b/Swiftcord/Views/OnboardingView.swift index d6adb17d..60991bde 100644 --- a/Swiftcord/Views/OnboardingView.swift +++ b/Swiftcord/Views/OnboardingView.swift @@ -13,22 +13,22 @@ struct OnboardingWelcomeView: View { let loadingNew: Bool let hasNew: Bool - var body: some View { - VStack(alignment: .leading, spacing: 16) { - Group { - var attributedTitle: AttributedString { - var attributedString: AttributedString = .init(localized: "onboarding.title \(appName ?? "")") + var attributedTitle: AttributedString { + var attributedString: AttributedString = .init(localized: "onboarding.title \(appName ?? "")") - let appNameRange = attributedString.range(of: appName ?? "") + let appNameRange = attributedString.range(of: appName ?? "") - if let appNameRange = appNameRange { - attributedString[appNameRange].foregroundColor = .accentColor - attributedString[appNameRange].font = .system(size: 72).weight(.heavy) - } + if let appNameRange = appNameRange { + attributedString[appNameRange].foregroundColor = .accentColor + attributedString[appNameRange].font = .system(size: 72).weight(.heavy) + } - return attributedString - } + return attributedString + } + var body: some View { + VStack(alignment: .leading, spacing: 16) { + Group { Text(attributedTitle) .font(.largeTitle)