-
Notifications
You must be signed in to change notification settings - Fork 2
Configuration
Key actors in an application's architecture are defined at the composition root by declaring the co-stars they interact with and configuration. Here's how to take care of the configuration.
In the project's 'Info' tab, define as many Xcode configurations as needed. By default we have DEBUG and RELEASE configurations.
pod install
after adding new configurations.
Add compiler flags.
protocol AppConfig {
var serviceUrl : URL { get }
var apiKey: String { get }
var daysToRetrieve: Int { get }
}
In your assemblies you can now return an instance confirming to the Config
protocol, depending on the current configuration. The configuration can be set in Xcode or via XCodeBuild scripts (eg within CI/CD environment).
var config: AppConfig {
#if STAGING
return StagingAppConfig()
#else
return ProductionAppConfig()
#endif
}
Something still not clear? How about posting a question on StackOverflow.
Get started in two minutes.
Get familiar with Pilgrim.
Become a Pilgrim expert.
For contributors or curious folks.