Display project version number

This commit is contained in:
Arkadiusz Fal 2021-11-08 21:07:36 +01:00
parent db9f7e5f5d
commit 3b7d54aab2

View File

@ -36,7 +36,7 @@ struct PlayerControlsView<Content: View>: View {
.foregroundColor(model.currentItem.isNil ? .secondary : .accentColor)
.lineLimit(1)
Text(model.currentItem?.video?.author ?? "Yattee v0.1")
Text(model.currentItem?.video?.author ?? "Yattee v\(appVersion)")
.fontWeight(model.currentItem.isNil ? .light : .bold)
.font(.system(size: 10))
.foregroundColor(.secondary)
@ -109,6 +109,10 @@ struct PlayerControlsView<Content: View>: View {
#endif
}
private var appVersion: String {
Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "unknown"
}
private var progressViewValue: Double {
[model.time?.seconds, model.videoDuration].compactMap { $0 }.min() ?? 0
}