Adds app version text to setting footer
This commit is contained in:
parent
2342ef2b76
commit
6cb4c46e4b
|
@ -167,7 +167,7 @@ struct SettingsView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
var help: some View {
|
var help: some View {
|
||||||
Section(header: Text("Help"), content: {
|
Section(header: Text("Help"), footer: Text(appVersion()).font(.caption2), content: {
|
||||||
Button("NetNewsWire Help", action: {
|
Button("NetNewsWire Help", action: {
|
||||||
viewModel.selectedWebsite = .netNewsWireHelp
|
viewModel.selectedWebsite = .netNewsWireHelp
|
||||||
}).foregroundColor(.primary)
|
}).foregroundColor(.primary)
|
||||||
|
@ -195,6 +195,13 @@ struct SettingsView: View {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func appVersion() -> String {
|
||||||
|
let dict = NSDictionary(contentsOf: Bundle.main.url(forResource: "Info", withExtension: "plist")!)
|
||||||
|
let version = dict?.object(forKey: "CFBundleShortVersionString") as? String ?? ""
|
||||||
|
let build = dict?.object(forKey: "CFBundleVersion") as? String ?? ""
|
||||||
|
return "NetNewsWire \(version) (Build \(build))"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SettingsView_Previews: PreviewProvider {
|
struct SettingsView_Previews: PreviewProvider {
|
||||||
|
|
Loading…
Reference in New Issue