edorphy / CloudKitWebServices

BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

Allow changing the container environment at runtime #1

Closed insidegui closed 2 years ago

insidegui commented 2 years ago

It is sometimes useful to be able to use the production environment in a debug build to test something. Currently, the environment is set to .development automatically for debug builds, and to .production for release builds, which I think is a great default, but it would be neat if the user of the library could override that manually if they want to.

If the idea is to replicate the CloudKit framework more closely, then this change could be provided at compile time with a flag different from DEBUG, which would take the place of the entitlement in the original framework.

Updated by Eric:

edorphy commented 2 years ago

I added environment as an initializer parameter for now. Eventually I'll add another constructor that takes in a configuration that can grab from the plist.

edorphy commented 2 years ago

Added to CKWSContainer.Configuration in 1c3d317d486419eaab30a679056ad7c853ac1fa0

Closing out.