metatext/Views/SwiftUI/AboutView.swift

47 lines
1.2 KiB
Swift
Raw Normal View History

2021-01-29 01:08:57 +00:00
// Copyright © 2021 Metabolist. All rights reserved.
import SwiftUI
struct AboutView: View {
var body: some View {
Form {
Section {
VStack(spacing: .defaultSpacing) {
Text("metatext")
.font(.largeTitle)
Text(verbatim: "\(Self.version) (\(Self.build))")
}
.padding()
}
.frame(maxWidth: .infinity, alignment: .center)
Section {
NavigationLink(
destination: AcknowledgmentsView()) {
Label("about.acknowledgments", systemImage: "curlybraces")
}
}
}
.navigationTitle("about")
}
}
private extension AboutView {
static var version: String {
Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? ""
}
static var build: String {
Bundle.main.object(forInfoDictionaryKey: kCFBundleVersionKey as String) as? String ?? ""
}
}
#if DEBUG
import PreviewViewModels
struct AboutView_Previews: PreviewProvider {
static var previews: some View {
AboutView()
}
}
#endif