/Beyond-the-Sandbox-App-Groups-in-Swift

Beyond the sandbox: using app groups to communicate between iOS or macOS apps (Xcode 13.2.1 and Swift 5.5)

Primary LanguageSwiftMIT LicenseMIT

Beyond the sandbox: using app groups to communicate between iOS or macOS apps

Summary: Apple's "app group" technology allows a collection of sandboxed macOS or iOS apps from the same development team, developer, vendor, etc., to all communicate with each other, coordinate functionality, share resources, and/or minimize redundancies. As long as all developers involved in creating apps meant to be part of an app group can securely share a Team ID from an Apple Developer portal account, they can write apps that can transcend sandboxing. Member apps of an app group share access to a special group container, a shared folder structure, whose root folder has the same name as the app group ID. In the sample app that accompanies this tutorial, several apps share a preference stored in a .plist file that lives in the special group container. The preference is the background color to be used by app group apps' UIView instances. If one app sets (writes) this shared background color preference to, say, the color green, other app group members read this preference and change their view layer backgroundColor property to NSColor.green.cgColor. There are two other color choices, red and blue. I've created the beginnings of a group of related apps sharing, say, settings, like a color scheme -- even if all the apps are sandboxed. ...

CONTINUE READING THE ENTIRE ARTICLE HERE...