1
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.

UIActivityを使ってSwiftからInstagramやSnapchatに写真を共有する

Posted at

UIActivityを使って各SNSへ写真の共有が出来るようにしようとして、Instagramの対応を行う時に一点ハマったのでメモ。

問題の箇所

  // シェア機能で共有したい項目
  let activityItems: [Any] = [<シェアする内容title, url, image>]
        
  // VCの初期化
  let activityVC = UIActivityViewController(activityItems: activityItems, applicationActivities: nil)

ここで、activityItemsに入れる項目の種類によって、選択できるActivitiesが変動しています。
InstagramやSnapchatを適用させたい場合はactivityItemsに画像のみを入れて初期化すると適用されます。

1
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
1
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?