Code Example

Store the string in Configly

Through Configly's intuitive web app you can store and update the string in moments.

/* iOS / Swift "Mobile Copy" example */
import configly
let client = CNGClient.setup(withApiKey: "Dem0apiKEY")

func setMarketingTagLine(
    callback: (String) -> ()
) {
  client.string(forKey: "marketing_tag_line") { (error, value) in
    if (error != nil) {
      print("Failed with error (error!.status): (error!.message)")
      return
    }
    guard let copy = value else {
      print("Could not find this key. Wrong API Key?")
      return
    }
 
    // In the real world, we would likely pass the result for 
    // rendering like: callback(copy)
 
    // But, to demonstrate the idea, lets simply print them
    print("Success! (copy)")
  }
}

The string is pulled down on-demand from the client.

The data is cached on-device to preserve battery life and bandwidth.