Skip to content

Instantly share code, notes, and snippets.

@mohsinbmwm3
Created January 18, 2021 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohsinbmwm3/fa58ca3cc0f4ca56ceac9bf84f6d989e to your computer and use it in GitHub Desktop.
Save mohsinbmwm3/fa58ca3cc0f4ca56ceac9bf84f6d989e to your computer and use it in GitHub Desktop.
Bundle extensions in swift
import Foundation
extension Bundle {
var appName: String? {
return Bundle.main.infoDictionary?["CFBundleName"] as? String
}
var appVersion: String? {
return Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
}
var bundleVersion: String? {
return Bundle.main.infoDictionary?["CFBundleVersion"] as? String
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment