From abc5f0f0d434f24e45771d0946f22fb875ea3d94 Mon Sep 17 00:00:00 2001 From: dadachi Date: Sun, 5 Apr 2026 08:58:01 +0900 Subject: [PATCH] Add app version and reorganize settings sections Split Information section into Support and About sections. Add app version display with Text(verbatim:) for non-localized labels. Co-Authored-By: Claude Opus 4.6 (1M context) --- NativeAppTemplate/Constants.swift | 1 - .../UI/Settings/SettingsView.swift | 30 ++++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/NativeAppTemplate/Constants.swift b/NativeAppTemplate/Constants.swift index b898d3e..895d3f4 100644 --- a/NativeAppTemplate/Constants.swift +++ b/NativeAppTemplate/Constants.swift @@ -220,7 +220,6 @@ extension String { static let myAccount = "My Account" static let profile = "Profile" - static let information = "Information" static let supportWebsite = "Support Website" static let howToUse = "How To Use" static let faqs = "FAQs" diff --git a/NativeAppTemplate/UI/Settings/SettingsView.swift b/NativeAppTemplate/UI/Settings/SettingsView.swift index 4fc6c13..7274581 100644 --- a/NativeAppTemplate/UI/Settings/SettingsView.swift +++ b/NativeAppTemplate/UI/Settings/SettingsView.swift @@ -52,11 +52,7 @@ struct SettingsView: View { } .listRowBackground(Color.cardBackground.opacity(0.7)) - Section(header: Text(String.information)) { - Link(destination: URL(string: String.supportWebsiteUrl)!) { - Label(String.supportWebsite, systemImage: "globe") - } - + Section(header: Text(verbatim: "Support")) { Link(destination: URL(string: String.howToUseUrl)!) { Label(String.howToUse, systemImage: "info") } @@ -74,12 +70,28 @@ struct SettingsView: View { } label: { Label(String.rateApp, systemImage: "hand.thumbsup") } + } + .listRowBackground(Color.cardBackground.opacity(0.7)) + Section(header: Text(verbatim: "About")) { + Link(destination: URL(string: String.supportWebsiteUrl)!) { + Label("Website", systemImage: "globe") + } Link(destination: URL(string: String.privacyPolicyUrl)!) { - Text(String.privacyPolicy) + Label(String.privacyPolicy, systemImage: "hand.raised") } Link(destination: URL(string: String.termsOfUseUrl)!) { - Text(String.termsOfUse) + Label(String.termsOfUse, systemImage: "doc.text") + } + } + .listRowBackground(Color.cardBackground.opacity(0.7)) + + Section(header: Text(verbatim: "App")) { + HStack { + Text(verbatim: "Version") + Spacer() + Text(appVersion) + .foregroundStyle(.secondary) } } .listRowBackground(Color.cardBackground.opacity(0.7)) @@ -109,6 +121,10 @@ struct SettingsView: View { .navigationBarTitleDisplayMode(.inline) } + private var appVersion: String { + "\(Bundle.main.appVersionLong) (\(Bundle.main.appBuild))" + } + var supportEmailURL: URL { let appName = Bundle.main.displayName let appVersion = "\(Bundle.main.appVersionLong)"