LoginSignup
15
12

More than 5 years have passed since last update.

AppGroupsでデータ共有 (準備編)

Last updated at Posted at 2016-10-25

はじめに

AppGroupsでアプリ間の共有を初めてやりました。
準備編として、AppGroupsの登録〜Xcodeでの設定についてまとめます。

アプリ間で文字列の共有と画像の共有してみました。
AppGroupsでデータ共有

App Groupsの登録

まずは、Apple Member CenterでAppGroupsを登録します。
ss01.png

Identifierは逆ドメイン記法でかきます。
ss02.png

内容を確認して登録します。
ss03.png

登録したものがAppGroupsのリストにあることを確認できると思います。

Xcodeでの設定

AppGroupsを使うアプリのプロジェクトファイルのCapabilitiesを開きます。
ss04.png

AppGroupsをONにして、Member Centerで登録したGroupにチェックをします。
ss05.png
こちらで選択したAppGroupsのidentifierはソースコード上でも使用します。

これで、準備が完了しました。

さいごに

今回はAppGroupsを使用する前の準備をまとめました。

15
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
12