Created
September 2, 2020 16:56
-
-
Save nixta/d5407996b24ab5749413bcd33fc6f326 to your computer and use it in GitHub Desktop.
Read and output ArcGIS Runtime SDK version text.
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
extension Bundle { | |
private static let agsBundle = AGSBundle() | |
/// An end-user printable string representation of the ArcGIS Bundle version shipped with the app. | |
/// | |
/// For example, "2883" | |
static var sdkBundleVersion: String { | |
return (agsBundle?.object(forInfoDictionaryKey: "CFBundleVersion") as? String) ?? "?" | |
} | |
/// An end-user printable string representation of the ArcGIS Runtime SDK version shipped with the app. | |
/// | |
/// For example, "100.9.0" | |
static var sdkVersion: String { | |
return (agsBundle?.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String) ?? "?" | |
} | |
/// Builds an end-user printable string representation of the ArcGIS Bundle shipped with the app. | |
/// | |
/// For example, "ArcGIS Runtime SDK 100.9.0 (2883)" | |
static var ArcGISSDKVersionString: String { | |
return String(format: "ArcGIS Runtime SDK %@ (%@)", sdkVersion, sdkBundleVersion) | |
} | |
} |
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
print("\(Bundle.ArcGISSDKVersionString)") | |
// Outputs, for example: | |
// ArcGIS Runtime SDK 100.7.0 (2632) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An addition to the above snippet, to print out the build number on a breakpoint in
lldb