File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,13 @@ struct SettingsPage: View {
2121 @State var logingOut : Bool = false
2222 @State private var safariURL : IdentifiableURL ?
2323
24+ // Get version and build number from Bundle
25+ private var appVersion : String {
26+ let version = Bundle . main. infoDictionary ? [ " CFBundleShortVersionString " ] as? String ?? " 1.0.0 "
27+ let build = Bundle . main. infoDictionary ? [ " CFBundleVersion " ] as? String ?? " 1 "
28+ return " 版本v \( version) ( \( build) ) "
29+ }
30+
2431 var body : some View {
2532 formView
2633 . navBar ( " 设置 " )
@@ -72,7 +79,7 @@ struct SettingsPage: View {
7279 } label: {
7380 SectionView ( " 关于 " ) {
7481 HStack {
75- Text ( " 版本1.0.0 " )
82+ Text ( appVersion )
7683 . font ( . footnote)
7784 . foregroundColor ( Color . tintColor)
7885 Image ( systemName: " chevron.right " )
You can’t perform that action at this time.
0 commit comments