Sharing UserDefaults between extensions

You cannot use UserDefaults.standard to share data between a host app and its app extension. You instead have to create a shared container with UserDefaults(suiteName:) to share data. Even though an app extension bundle is nested within its containing app’s bundle, the running app extension and containing app have no direct access to each other’s … Read more