From 3b7d54aab2b5135332411feeb45c15a017feb537 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 8 Nov 2021 21:07:36 +0100 Subject: [PATCH] Display project version number --- Shared/Views/PlayerControlsView.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Shared/Views/PlayerControlsView.swift b/Shared/Views/PlayerControlsView.swift index ae0d379c..2cc40a79 100644 --- a/Shared/Views/PlayerControlsView.swift +++ b/Shared/Views/PlayerControlsView.swift @@ -36,7 +36,7 @@ struct PlayerControlsView: 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: 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 }