Hello I'm trying to publish a iOS (SWIFT) personal project in GitHub but I'm afraid of sharing my private API keys and secrets with everybody.
I'm using parse so I have in my AppDelegate something like this:
let applicationId = "mySecretApplicationId"
let clientKey = "mySecretClientKey"
Parse.setApplicationId(applicationId!, clientKey: clientKey!)
I would like to hide "mySecretApplicationId" and "mySecretClientKey", is there private place or directory in my project where I can put this variables?
Thanks!
You can use a
.plistfile where you store all your important keys. It is very important to put this file into your.gitignorefile.In your case, you need to set your
keys.plistfile like this:And use it inside your AppDelegate as follows:
SWIFT 3 Update: