Data Sharing Using AppGroups

Shantaram Kokate
1 min readAug 14, 2020

--

Let’s share strings and images between apps using AppGroups.

Share strings with UserDefaults

UserDefaults(suiteName:)Use the.
For suiteName, set the identifier of AppGroups selected in Capabilities of the project file.

You can share info between apps in the same AppGroup.

Share images with File Manager

FileManager.default.containerURL(forSecurityApplicationGroupIdentifier:)Use the. Again, like
UserDefaults set the identifier of AppGroups selected in the Capabilities of the project file. I tried the code like this.
(The above saveMessage and loadMessage are also used.)

This can also be shared between apps in the same AppGroup.

If you like this post, please share and give claps so others can find it 👏👏

You can follow me on Medium for updated articles. Also, connect with me on LinkedIn, Twitter.

If you have any comments, questions, or recommendations, feel free to post them in the comment section below!👇

--

--