Skip to content

Commit

Permalink
new version of app in Settings (#108)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandr Chernyy <[email protected]>
  • Loading branch information
alexchornyi and pingus-nikalex authored Sep 30, 2021
1 parent 90543ab commit 07e9291
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/Components/AppVersionCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public class AppVersionCell: UITableViewCell {
public override func layoutSubviews() {
super.layoutSubviews()

let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
let version = Bundle.main.releaseVersionNumber as? String ?? "-"
let buold = Bundle.main.buildVersionNumber as? String ?? "-"
let format = l10n("app-version")
versionLabel.text = String(format: format, version ?? "?")
removeSectionSeparator()
Expand Down
17 changes: 17 additions & 0 deletions Sources/Extensions/Bundle+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// File.swift
//
//
// Created by Alexandr Chernyy on 30.09.2021.
//

import Foundation

extension Bundle {
var releaseVersionNumber: String? {
infoDictionary?["CFBundleShortVersionString"] as? String
}
var buildVersionNumber: String? {
infoDictionary?["CFBundleVersion"] as? String
}
}

0 comments on commit 07e9291

Please sign in to comment.