Have you ever wished you could change some config parameter for your app without deploying a new version? Of course you have! Wouldn’t it be great if you had whole config for your app in the cloud and change it as you see fit? Of course it would! Well, go ahead, just put some config somewhere in the cloud and MissionControl will take care of the rest for you.
This code will get you started:
// Local Config let config: [String : AnyObject] = [ "Ready" : true, "LaunchForce" : 0.21 ] // Remote Config Endpoint // Format the config as a JSON payload let remoteURL = NSURL(string: "http://appculture.com/mission-control")! // Initialize Misson Control. // Settings from the remote config will overwrite the local config MissionControl.launch(localConfig: config, remoteConfigURL: remoteURL) // Get config values using helper accessors let ready = ConfigBool("Ready", fallback: false) let numberOfSeconds = ConfigInt("CountdownDuration", fallback: 10) let launchForce = ConfigDouble("LaunchForce", fallback: 0.5) let color = ConfigString("ReadyColor", fallback: "#7ED321")
Implementing this yourself is fairly easy:
fetch() the remote config, and merge it with your local one using