3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AppExtensionについて

iOS8のApp Extensionsをつくってみる(Share 実装編)

App Extensions プログラミングガイドをざっくりまとめた
の記事が分かりやすいです。
簡単にいうと、アプリ間連携の仕組みになります。

概念

gainen.png

ホストとなるアプリとExtensionバイナリをAppGroupでグルーピングして共有ファイル/データへアクセスできるようにします。

手順

前提
・すでにプロジェクトが出来上がっていること前提。
・AppleDeveloperアカウントを持っていること

1.Extensionスキームを追加

extension.png

Targets欄の"+"ボタンを押して、Action Extensionのスキームを追加。

2.本体アプリにバイナリ追加

embedBinary.png

GeneralタブのEmbedBinaryの"+"ボタンをタップし、先ほど追加したExtensionのスキームを追加

3.Entitlementsファイルを設定

entitlements.png

CapabilitiesタブでAppGroupをOnにするとEntitlementsファイルが作成されます。
ホストアプリのスキームとExtensionのスキーム両方に設定。

4.AppGroupを設定

addGroup.png

AddGroupsの"+"ボタンをタップしてGroupを追加します。
ホストアプリのスキームとExtensionのスキーム両方に設定。

5.AppleDeveloperでAppGroupを追加

AppGroupAssignment.png

Group名は先ほどプロジェクトで追加したGroup名

6.ビルドするAppIDとAppGroupをつなげる

appIdGroup.png
ホストアプリとExtension両方に設定。
設定後、プロビジョニングプロファイルを作成し、ダウンロード。

7.Extensionのplist設定

plist.png
BundleDisplayNameとNSExtensionActivationRuleを設定。

参考にした記事

3
2
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?