From 12cbb2c763c15a5ff7a323feab368c7f3d6604ca Mon Sep 17 00:00:00 2001 From: Kirill Shakhansky Date: Thu, 17 Oct 2024 17:09:26 +0300 Subject: [PATCH] swiftformat --- TestApp/Sources/About/AboutSectionView.swift | 41 ++++++++++---------- TestApp/Sources/About/AboutView.swift | 12 +++--- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/TestApp/Sources/About/AboutSectionView.swift b/TestApp/Sources/About/AboutSectionView.swift index b5baa5ec..a825dd65 100644 --- a/TestApp/Sources/About/AboutSectionView.swift +++ b/TestApp/Sources/About/AboutSectionView.swift @@ -7,17 +7,16 @@ import SwiftUI struct AboutSectionView: View { - enum Icon: String { case app = "app.badge" case circle = "c.circle" case hands = "hands.sparkles" } - + private let title: String private let icon: Icon private var content: () -> Content - + init( title: String, icon: Icon, @@ -27,7 +26,7 @@ struct AboutSectionView: View { self.icon = icon self.content = content } - + var body: some View { GroupBox { content() @@ -46,23 +45,23 @@ struct AboutSectionView: View { #Preview { AboutSectionView(title: "Version", icon: .app) { - VStack { - HStack { - Text("App Version:") - .foregroundColor(.gray) - Spacer() - Text("alpha-3.0") - .foregroundColor(.primary) - } - - HStack(spacing: 10) { - Text("Build Version:") - .foregroundColor(.gray) - Spacer() - Text("alpha-3.0") - .foregroundColor(.primary) - } + VStack { + HStack { + Text("App Version:") + .foregroundColor(.gray) + Spacer() + Text("alpha-3.0") + .foregroundColor(.primary) + } + + HStack(spacing: 10) { + Text("Build Version:") + .foregroundColor(.gray) + Spacer() + Text("alpha-3.0") + .foregroundColor(.primary) } } - .padding() + } + .padding() } diff --git a/TestApp/Sources/About/AboutView.swift b/TestApp/Sources/About/AboutView.swift index 6af0c10a..c907dc25 100644 --- a/TestApp/Sources/About/AboutView.swift +++ b/TestApp/Sources/About/AboutView.swift @@ -17,7 +17,7 @@ struct AboutView: View { .padding(.horizontal, 16) } } - + private var versionSection: some View { AboutSectionView( title: "Version", @@ -31,7 +31,7 @@ struct AboutView: View { Text(.appVersion ?? "") .foregroundColor(.primary) } - + HStack(spacing: 10) { Text("Build Version:") .foregroundColor(.secondary) @@ -42,7 +42,7 @@ struct AboutView: View { } } } - + private var copyrightSection: some View { AboutSectionView( title: "Copyright", @@ -53,7 +53,7 @@ struct AboutView: View { Text("© 2022 European Digital Reading Lab") .multilineTextAlignment(.leading) } - + Link(destination: .license) { Text("[BSD-3 License]") .multilineTextAlignment(.leading) @@ -62,7 +62,7 @@ struct AboutView: View { .frame(maxWidth: .infinity, alignment: .leading) } } - + private var acknowledgementsSection: some View { AboutSectionView( title: "Acknowledgements", @@ -90,7 +90,7 @@ struct About_Previews: PreviewProvider { private extension String { static let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String - + static let buildVersion = Bundle.main.infoDictionary?["CFBundleVersion"] as? String }