Commit 07a4f345 authored by Steven杜宇's avatar Steven杜宇

// app信息

parent 8a6ad1ea
...@@ -99,8 +99,10 @@ extension UIDevice { ...@@ -99,8 +99,10 @@ extension UIDevice {
static func appVersion() -> String { static func appVersion() -> String {
let infoDictionary = Bundle.main.infoDictionary let infoDictionary = Bundle.main.infoDictionary
if let infoDictionary = infoDictionary { if let infoDictionary = infoDictionary {
let appVersion = infoDictionary["CFBundleShortVersionString"] if let appVersion = infoDictionary["CFBundleShortVersionString"] as? String {
return appVersion as! String return appVersion
}
} }
return " " return " "
} }
...@@ -109,8 +111,9 @@ extension UIDevice { ...@@ -109,8 +111,9 @@ extension UIDevice {
static func appBuild() -> String { static func appBuild() -> String {
let infoDictionary = Bundle.main.infoDictionary let infoDictionary = Bundle.main.infoDictionary
if let infoDictionary = infoDictionary { if let infoDictionary = infoDictionary {
let appBuild = infoDictionary["CFBundleVersion"] if let appBuild = infoDictionary["CFBundleVersion"] as? String {
return appBuild as! String return appBuild
}
} }
return " " return " "
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment