Shared Containers is simply a UserDefault dictionary that is shared between Extensions in an App. To store data in the container Init your container using the suiteName
UserDefault:
let SharedDefaults = UserDefaults.init(suiteName: "group.com.YOURGROUP")!
TheN to set a value, in this case a String
:
SharedDefaults.set("something", forKey: "aKey")
And to retrieve the information (from either the Extension or App) use:
let myString = SharedDefaults.string(forKey: "aKey")
This explains how to to print the contents of the UserDefaults: Easy way to see saved NSUserDefaults?