aboutsummaryrefslogtreecommitdiff
path: root/iosApp/iosApp/Session/AboutView.swift
blob: 1f0c4c706bca25e38d9c799c127e6c20e3bf854c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
//  AboutView.swift
//  iosApp
//
//  Created by Iván on 15/02/22.
//  Copyright © 2022 orgName. All rights reserved.
//

import SwiftUI

struct AboutView: View {
    
    private func getVersion() -> String? {
        return Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
    }
    
    var body: some View {
        List {
            Text("about-text").padding()
            if let version = getVersion() {
                HStack {
                    Text("version")
                    Spacer()
                    Text(version).foregroundColor(.secondary)
                }
            }
            
            Button {
                if let url = URL(string: NSLocalizedString("app-website", comment: "")) {
                    if UIApplication.shared.canOpenURL(url) {
                        UIApplication.shared.open(url, options: [:])
                    }
                }            } label: {
                Label("website", systemImage: "globe")
            }
        }
    }
}