Skip to content
Snippets Groups Projects
Commit d9f89ee8 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Merge branch 'feature/example-app-version' into 'development'

Example app version

See merge request elixxir/elixxir-dapps-sdk-swift!119
parents 6f07a194 73f52d85
No related branches found
No related tags found
2 merge requests!119Example app version,!102Release 1.0.0
......@@ -413,6 +413,7 @@ let package = Package(
.target(
name: "WelcomeFeature",
dependencies: [
.target(name: "AppCore"),
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
.product(name: "XXMessengerClient", package: "elixxir-dapps-sdk-swift"),
],
......
import SwiftUI
public struct AppVersionText: View {
public init() {}
public var body: some View {
Text("v\(version) (\(build))")
}
var version: String = Bundle.main.shortVersionString ?? "0.0.0"
var build: String = Bundle.main.versionString ?? "0"
}
private extension Bundle {
var shortVersionString: String? {
infoDictionary?["CFBundleShortVersionString"] as? String
}
var versionString: String? {
infoDictionary?["CFBundleVersion"] as? String
}
}
#if DEBUG
struct AppVersionText_Previews: PreviewProvider {
static var previews: some View {
AppVersionText()
.padding()
.previewLayout(.sizeThatFits)
}
}
#endif
import AppCore
import BackupFeature
import ComposableArchitecture
import ComposablePresentation
......@@ -137,6 +138,12 @@ public struct HomeView: View {
} header: {
Text("Account")
}
Section {
AppVersionText()
} header: {
Text("App version")
}
}
.navigationTitle("Home")
.alert(
......
import AppCore
import ComposableArchitecture
import SwiftUI
......@@ -23,7 +24,9 @@ public struct WelcomeView: View {
NavigationView {
Form {
Section {
Text("xx messenger")
AppVersionText()
} header: {
Text("App version")
}
if let failure = viewStore.failure {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment