Introspection
A Swift package which aides in checking information about the current app, system, & device.
The app bundle
This includes some sugar for reading your app bundle:
import Introspection
Introspection.bundleId // The ID of the main bundle, as read from its info dictionary (e.g. `com.acme.MyApp`)
Introspection.appName // The name of your app, as read from its bundle info
Introspection.appVersion // The semantic version of your app, as read from its bundle info, parsed into a `SemVer` value
This package also includes a generic version reader for any bundle:
import Introspection
Introspection.Bundle.id(of: Bundle(for: SomeClass.self))
Introspection.Bundle.name(of: Bundle(for: SomeClass.self))
Introspection.Bundle.version(of: Bundle(for: SomeClass.self))
And makes general bundle access easier:
import Introspection
let accentColorName: String? = Introspection.Bundle["NSAccentColorName"]
let supportedPlatforms: [String]? = Introspection.Bundle["CFBundleSupportedPlatforms"]
The device
This also lets you check info about the current device:
import Introspection
Introspection.Device.modelType == .iPhone
Introspection.Device.class == .laptop