A) What I Expect:
In Swift, I have learned that in order to access values of my Info plist, I have to:
- right click on my Info file
- select Open As and Source Code (this will show the plist in XML format)
- find the key I am interested in in the now as XML presented Info plist file
- access the value I am interested in using the key I have looked up in the XML like this:
let value = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as? String ?? "n.a."
B) What I Get:
- The problem I am facing is that my Info plist does not contain the key-value pairs for things like version number or build number (see below).
- For example
CFBundleShortVersionStringis not listed in there. Note that the command under point 4 above still works! - Opening a brand new Xcode project, using Swift 5 and Xcode 14.3.1, my Info plist opened as XML look looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Test</key>
<string>TestValue</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>
C) My Question:
Could someone tell me how I would find the proper key-value pairs for all my system configurations?