Skip to content

Instantly share code, notes, and snippets.

@Shilo
Created June 6, 2022 07:18
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 Shilo/ab05525cb632283386b7a0dff4cba91d to your computer and use it in GitHub Desktop.
Save Shilo/ab05525cb632283386b7a0dff4cba91d to your computer and use it in GitHub Desktop.
Swift extension for getting app info.
//
// Bundle+Addition.swift
//
//
// Created by Shilo White on 6/3/22.
//
import Foundation
extension Bundle {
var displayName: String? {
return object(forInfoDictionaryKey: "CFBundleDisplayName") as? String ??
object(forInfoDictionaryKey: "CFBundleName") as? String
}
var appVersion: String? {
return object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment