You need first to add a variable inside your Info.plist, than you can read the variable from it.
For example if you have a MyConfig.xcconfig file like this:
MY_SECRET_API_KEY = mysupersecretapikeyvaluehere
In your Info.plist you should add an entry like this:
<key>MySecretApiKey</key>
<string>$(MY_SECRET_API_KEY)</string>
Finally in your code read the value of your variable like this:
guard let infoDictionary: [String: Any] = Bundle.main.infoDictionary else { return }
guard let mySecretApiKey: String = infoDictionary["MySecretApiKey"] as? String else { return }
print("Here's your api key value -> \(mySecretApiKey)")