Upgrade to Pro — share decks privately, control downloads, hide ads and more …

「シェア機能」について考えてみた

 「シェア機能」について考えてみた

PKPK-Carnage

October 23, 2019
Tweet

More Decks by PKPK-Carnage

Other Decks in Programming

Transcript

  1. About me • Tomosuke Okada • iOSྺ3೥ • ອըͷΞϓϦΛ࡞ͬͯ·͢ •

    SNS • Qiita → @fr0g_fr0g • Github → Frog-Frog • Twitter → @fr0g_fr0g • μϒϧϑϩοά
  2. 17

  3. ࣮૷ͯ͠Έͨ 18 final class StoriesSharer { private let urlScheme =

    URL(string: "instagram-stories://share")! func share() { guard UIApplication.shared.canOpenURL(self.urlScheme) else { return } let item: [String: Any] = [ "com.instagram.sharedSticker.backgroundImage": UIImage(named: "StoryBackgroundImage")!.pngData()!, "com.instagram.sharedSticker.stickerImage": UIImage(named: "StoryStickerImage")!.pngData()! ] let options = [UIPasteboard.OptionsKey.expirationDate: Date().addingTimeInterval(60 * 5)] UIPasteboard.general.setItems([item], options: options) UIApplication.shared.open(self.urlScheme, options: [:], completionHandler: nil) } }
  4. (PPE #BE 20 • ࣗ࡞ͰಋઢΛ࡞Δඞཁ͕͋Δ • എܠɺεςοΧʔͷ४උ͕͍Δ • ετʔϦʔζ͔Β௚઀ΞϓϦʹඈ͹ ͢ʹ͸Instagramଆʹਃ੥͕ඞཁ

    • ࣮૷͕͔ͳΓ؆୯ • ࠓ࣌ͷएऀʹਓؾ • ଞΞϓϦͷγΣΞΑΓࣗ༝౓͕ߴ͍ • ΞϓϦެࣜΠϯελάϥϜΞΧ΢ϯ τͱ͔΋੝Γ্͛ΕΔ