updated version
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
ee772648b1
commit
4dd121f961
@ -650,7 +650,7 @@
|
|||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 17;
|
CURRENT_PROJECT_VERSION = 18;
|
||||||
DEVELOPMENT_TEAM = 59V5935DHZ;
|
DEVELOPMENT_TEAM = 59V5935DHZ;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
INFOPLIST_FILE = VDSSample/Info.plist;
|
INFOPLIST_FILE = VDSSample/Info.plist;
|
||||||
@ -680,7 +680,7 @@
|
|||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 17;
|
CURRENT_PROJECT_VERSION = 18;
|
||||||
DEVELOPMENT_TEAM = 59V5935DHZ;
|
DEVELOPMENT_TEAM = 59V5935DHZ;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
INFOPLIST_FILE = VDSSample/Info.plist;
|
INFOPLIST_FILE = VDSSample/Info.plist;
|
||||||
|
|||||||
@ -65,27 +65,17 @@ class MenuCell: UITableViewCell {
|
|||||||
|
|
||||||
class MenuViewController: UITableViewController, TooltipLaunchable {
|
class MenuViewController: UITableViewController, TooltipLaunchable {
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
title = "VDS Sample: Build \(Bundle.main.buildNumber ?? "none")"
|
title = "VDS Sample: Build \(Bundle.main.build ?? "none")"
|
||||||
let tooltip = VDS.Tooltip()
|
let tooltip = VDS.Tooltip()
|
||||||
tooltip.title = "Release Notes"
|
let bundle = VDS.Bundle(for: VDS.Badge.self)
|
||||||
tooltip.content = getReleaseNotes()
|
tooltip.title = "Release Notes: \(bundle.build ?? "")"
|
||||||
|
tooltip.content = bundle.contents("ReleaseNotes")
|
||||||
navigationItem.rightBarButtonItem = UIBarButtonItem(customView: tooltip) // UIBarButtonItem(barButtonSystemItem: .compose, target: self, action: #selector(buildInfoTapped))
|
navigationItem.rightBarButtonItem = UIBarButtonItem(customView: tooltip) // UIBarButtonItem(barButtonSystemItem: .compose, target: self, action: #selector(buildInfoTapped))
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
overrideUserInterfaceStyle = .light
|
overrideUserInterfaceStyle = .light
|
||||||
tableView.register(MenuCell.self, forCellReuseIdentifier: "cell")
|
tableView.register(MenuCell.self, forCellReuseIdentifier: "cell")
|
||||||
}
|
}
|
||||||
|
|
||||||
func getReleaseNotes() -> String {
|
|
||||||
let bundle = VDS.Bundle(for: VDS.Badge.self)
|
|
||||||
guard let fileURL = bundle.url(forResource: "ReleaseNotes", withExtension: "txt") else { return "none" }
|
|
||||||
do {
|
|
||||||
return try String(contentsOf: fileURL)
|
|
||||||
} catch {
|
|
||||||
print("error reading releaseNotes")
|
|
||||||
return "none"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let items: [MenuComponent] = [
|
let items: [MenuComponent] = [
|
||||||
MenuComponent(title: "Badge", completed: true, viewController: BadgeViewController.self),
|
MenuComponent(title: "Badge", completed: true, viewController: BadgeViewController.self),
|
||||||
MenuComponent(title: "Button", completed: true, viewController: ButtonViewController.self),
|
MenuComponent(title: "Button", completed: true, viewController: ButtonViewController.self),
|
||||||
@ -169,7 +159,25 @@ class MenuViewController: UITableViewController, TooltipLaunchable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension Bundle {
|
extension Bundle {
|
||||||
|
var versionNumber: String? {
|
||||||
|
infoDictionary?["CFBundleShortVersionString"] as? String
|
||||||
|
}
|
||||||
var buildNumber: String? {
|
var buildNumber: String? {
|
||||||
infoDictionary?["CFBundleVersion"] as? String
|
infoDictionary?["CFBundleVersion"] as? String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var build: String? {
|
||||||
|
guard let versionNumber, let buildNumber else { return nil }
|
||||||
|
return "\(versionNumber).\(buildNumber)"
|
||||||
|
}
|
||||||
|
|
||||||
|
func contents(_ fileName: String, fileExtension: String = "txt" ) -> String {
|
||||||
|
guard let fileURL = url(forResource: fileName, withExtension: fileExtension) else { return "none" }
|
||||||
|
do {
|
||||||
|
return try String(contentsOf: fileURL)
|
||||||
|
} catch {
|
||||||
|
print("error reading releaseNotes")
|
||||||
|
return "none"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user