Created
November 13, 2020 15:09
-
-
Save sayler8182/a96ec7f9622cea05c78f18491170f92e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: Bundle | |
public extension Bundle { | |
var appVersion: String { | |
return self.info(for: "CFBundleShortVersionString", or: "0.0.0") | |
} | |
var bundleId: String { | |
return self.info(for: "CFBundleIdentifier") | |
} | |
func info(for key: String, | |
or default: String = "") -> String! { | |
let value: String? = self.object(forInfoDictionaryKey: key) as? String | |
return value ?? "" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment