Skip to content

Instantly share code, notes, and snippets.

@matteospada
Last active August 14, 2022 14:37
Show Gist options
  • Select an option

  • Save matteospada/5e1c671fc5c9b22fcc977790940e3cee to your computer and use it in GitHub Desktop.

Select an option

Save matteospada/5e1c671fc5c9b22fcc977790940e3cee to your computer and use it in GitHub Desktop.
import SwiftUI
extension Bundle {
var buildNumber: String {
return infoDictionary?["CFBundleVersion"] as! String
}
}
struct ContentView: View {
var body: some View {
Text("\(Bundle.main.buildNumber)")
.padding()
.frame(width: 300, height: 200)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment