SlideShare a Scribd company logo
kitasuke@trippiece
Ref. http://cnet4.cbsistatic.com/hub/i/r/2014/09/09/1d101da2-7abd-40aa-b0c9- 
94e4f9b27b95/thumbnail/770x433/c2705e97ac76cc74f2c19abc83929de9/apple-event- 
apple-watch-5446.jpg 
Ref. http://cdn.macrumors.com/article-new/ 
2014/09/applewatch2.jpg
Today 
Share 
←今日はこれ 
Action 
Photo Editing 
Storage Provider 
Custom Keyboard
SNSへの投稿 
コンテンツの共有
e.g. Twitter e.g. Pocket
1. Share Extension用のターゲット追加 
2. App Groupsの設定 
3. NSExtensionAttributesの設定 
4. Containing app側での認証・バリデー 
ション・アップロード処理の実装 
5. Host app側での更新処理実装
e.g. Capabilities
e.g. Info.plist
e.g. SLComposeServiceViewController
 ローカル→ NSUserDefaults 
 サーバー→ NSURLSessionでアップロード
1. NSExtensionContextのinputItemsからNSExtensionItemを取得 
2. NSExtensionItemのattachmentsから各NSItemProviderを取得 
3. loadItemForTypeIdentifier: options: completionHandler: で各コ 
ンテンツを取得
Pocketの辞書版を作りたい 
Safariで英語の記事を読んでいて、分 
からない単語があれば保存して後で 
調べる 
→ Safariで選択中のテキストを 
Share Extensionで保存する
1. Safari上での情報を取得したい(そもそも可能?) 
2. テキストだけ共有したい 
(NSExtensionActivationSupportsImageWithMaxCo 
untをゼロにしても駄目だった) 
←勝手に表示される 
この画像が不要
 Extensionタスク開始時に実行されるrun関数 
 Extensionタスク終了時に実行されるfinalize関数 
Info.plistのNSExtensionAttributes以下の 
NSExtensionJavaScriptPreprocessingFileにファイル名を指定する 
* JavaScriptファイルを使用すると、 
kUTTypePropertyListタイプのNSItemProviderがセット 
される
1. JavaScriptファイルを 
NSExtensionJavaScriptPreprocessingFileに設定 
2. Safariが選択中の文字列とサイトURLを取得する処 
理をJavaScriptで実装 
3. 選択された文字列をテキストビューに表示 
4. Postボタンを押すと、選択された文字列とURLを 
NSUserDefaultsに保存 
5. Host appでNSUserDefaultsからコンテンツ取得
デモ
 情報量が少ないが思ったより簡単 
 ログ見ながら手探りで進める 
Apple Watch用アプリを開発 
出来ると思って、わくわくし 
ながら開発するのが大事
Share Extension@pixiv

More Related Content

Viewers also liked

Search APIs & Universal Links
Search APIs & Universal LinksSearch APIs & Universal Links
Search APIs & Universal Links
Yusuke Kita
 
WKInterfaceMap on Apple Watch
WKInterfaceMap on Apple WatchWKInterfaceMap on Apple Watch
WKInterfaceMap on Apple Watch
Yusuke Kita
 
Swift core
Swift coreSwift core
Swift core
Yusuke Kita
 
Useful and Practical Functionalities in Realm
Useful and Practical Functionalities in RealmUseful and Practical Functionalities in Realm
Useful and Practical Functionalities in Realm
Yusuke Kita
 
Uiテスト@yidev
Uiテスト@yidevUiテスト@yidev
Uiテスト@yidev
Yusuke Kita
 
WWDCのチケット外れてもSFに行った方が良い理由
WWDCのチケット外れてもSFに行った方が良い理由WWDCのチケット外れてもSFに行った方が良い理由
WWDCのチケット外れてもSFに行った方が良い理由
Yusuke Kita
 
Protocol in Swift
Protocol in SwiftProtocol in Swift
Protocol in Swift
Yusuke Kita
 
Introducing Cardio
Introducing CardioIntroducing Cardio
Introducing Cardio
Yusuke Kita
 
Search APIs in Spotlight and Safari
Search APIs in Spotlight and SafariSearch APIs in Spotlight and Safari
Search APIs in Spotlight and Safari
Yusuke Kita
 
Advanced realm in swift
Advanced realm in swiftAdvanced realm in swift
Advanced realm in swift
Yusuke Kita
 
iOSにおけるUIテスト@potetotips
iOSにおけるUIテスト@potetotipsiOSにおけるUIテスト@potetotips
iOSにおけるUIテスト@potetotips
Yusuke Kita
 
User Scenario based UI testing with KIF
User Scenario based UI testing with KIFUser Scenario based UI testing with KIF
User Scenario based UI testing with KIF
Yusuke Kita
 
How to make workout app for watch os 2
How to make workout app for watch os 2How to make workout app for watch os 2
How to make workout app for watch os 2
Yusuke Kita
 
Command Line Tool in swift
Command Line Tool in swiftCommand Line Tool in swift
Command Line Tool in swift
Yusuke Kita
 

Viewers also liked (14)

Search APIs & Universal Links
Search APIs & Universal LinksSearch APIs & Universal Links
Search APIs & Universal Links
 
WKInterfaceMap on Apple Watch
WKInterfaceMap on Apple WatchWKInterfaceMap on Apple Watch
WKInterfaceMap on Apple Watch
 
Swift core
Swift coreSwift core
Swift core
 
Useful and Practical Functionalities in Realm
Useful and Practical Functionalities in RealmUseful and Practical Functionalities in Realm
Useful and Practical Functionalities in Realm
 
Uiテスト@yidev
Uiテスト@yidevUiテスト@yidev
Uiテスト@yidev
 
WWDCのチケット外れてもSFに行った方が良い理由
WWDCのチケット外れてもSFに行った方が良い理由WWDCのチケット外れてもSFに行った方が良い理由
WWDCのチケット外れてもSFに行った方が良い理由
 
Protocol in Swift
Protocol in SwiftProtocol in Swift
Protocol in Swift
 
Introducing Cardio
Introducing CardioIntroducing Cardio
Introducing Cardio
 
Search APIs in Spotlight and Safari
Search APIs in Spotlight and SafariSearch APIs in Spotlight and Safari
Search APIs in Spotlight and Safari
 
Advanced realm in swift
Advanced realm in swiftAdvanced realm in swift
Advanced realm in swift
 
iOSにおけるUIテスト@potetotips
iOSにおけるUIテスト@potetotipsiOSにおけるUIテスト@potetotips
iOSにおけるUIテスト@potetotips
 
User Scenario based UI testing with KIF
User Scenario based UI testing with KIFUser Scenario based UI testing with KIF
User Scenario based UI testing with KIF
 
How to make workout app for watch os 2
How to make workout app for watch os 2How to make workout app for watch os 2
How to make workout app for watch os 2
 
Command Line Tool in swift
Command Line Tool in swiftCommand Line Tool in swift
Command Line Tool in swift
 

Similar to Share Extension@pixiv

Google I/O 2016 報告会
Google I/O 2016 報告会Google I/O 2016 報告会
Google I/O 2016 報告会
shingo suzuki
 
Visual StudioやAzureからAzure DevOpsを使う
Visual StudioやAzureからAzure DevOpsを使うVisual StudioやAzureからAzure DevOpsを使う
Visual StudioやAzureからAzure DevOpsを使う
Takeshi Fukuhara
 
Tekton 入門
Tekton 入門Tekton 入門
Tekton 入門
Mamoru Shimizu
 
Azure DevOps Online Vol.3 - Inside Azure Pipelines
Azure DevOps Online Vol.3 - Inside Azure PipelinesAzure DevOps Online Vol.3 - Inside Azure Pipelines
Azure DevOps Online Vol.3 - Inside Azure Pipelines
Kazushi Kamegawa
 
S07 Azure バックアップを利用したオンプレミス Windows Server のバックアップ
S07 Azure バックアップを利用したオンプレミス Windows Server のバックアップS07 Azure バックアップを利用したオンプレミス Windows Server のバックアップ
S07 Azure バックアップを利用したオンプレミス Windows Server のバックアップMicrosoft Azure Japan
 
Logic Apps/Flow Update Summary
Logic Apps/Flow Update SummaryLogic Apps/Flow Update Summary
Logic Apps/Flow Update Summary
Tomoyuki Obi
 
20190731 Azure Functions x Line at Azure Tech Lab #4
20190731 Azure Functions x Line at Azure Tech Lab #420190731 Azure Functions x Line at Azure Tech Lab #4
20190731 Azure Functions x Line at Azure Tech Lab #4
Issei Hiraoka
 
Interactive connection2
Interactive connection2Interactive connection2
Interactive connection2
Takao Tetsuro
 
NET MAUI for .NET 7 for iOS, Android app development
 NET MAUI for .NET 7 for iOS, Android app development  NET MAUI for .NET 7 for iOS, Android app development
NET MAUI for .NET 7 for iOS, Android app development
Shotaro Suzuki
 
Ec cube開発合宿 プラグインセミナー
Ec cube開発合宿 プラグインセミナーEc cube開発合宿 プラグインセミナー
Ec cube開発合宿 プラグインセミナーAyumu Kawaguchi
 
はてなにおける継続的デプロイメントの現状と Docker の導入
はてなにおける継続的デプロイメントの現状と Docker の導入はてなにおける継続的デプロイメントの現状と Docker の導入
はてなにおける継続的デプロイメントの現状と Docker の導入
Yu Nobuoka
 
[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送
[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送
[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送
Google Cloud Platform - Japan
 
Flex's DI Container
Flex's DI ContainerFlex's DI Container
Flex's DI Container
Masaaki Yonebayashi
 
環境構築自動化ツールのご紹介
環境構築自動化ツールのご紹介環境構築自動化ツールのご紹介
環境構築自動化ツールのご紹介Etsuji Nakai
 
LabVIEW NXG Web Module Training Slide
LabVIEW NXG Web Module Training SlideLabVIEW NXG Web Module Training Slide
LabVIEW NXG Web Module Training Slide
Yusuke Tochigi
 
Tech talk salesforce mobile sdk
Tech talk   salesforce mobile sdkTech talk   salesforce mobile sdk
Tech talk salesforce mobile sdkKazuki Nakajima
 
Whats service mesh & istio ?
Whats service mesh & istio ?Whats service mesh & istio ?
Whats service mesh & istio ?
cyberblack28 Ichikawa
 
2021/03/19 パブリッククラウドを活かす運用プロセス自動化
2021/03/19 パブリッククラウドを活かす運用プロセス自動化2021/03/19 パブリッククラウドを活かす運用プロセス自動化
2021/03/19 パブリッククラウドを活かす運用プロセス自動化
Issei Hiraoka
 
エンプラに Kubernetes を 導入してみて分かった 4つの Lessons Learned
エンプラに Kubernetes を 導入してみて分かった 4つの Lessons Learnedエンプラに Kubernetes を 導入してみて分かった 4つの Lessons Learned
エンプラに Kubernetes を 導入してみて分かった 4つの Lessons Learned
Daiki Kawanuma
 

Similar to Share Extension@pixiv (20)

Google I/O 2016 報告会
Google I/O 2016 報告会Google I/O 2016 報告会
Google I/O 2016 報告会
 
Visual StudioやAzureからAzure DevOpsを使う
Visual StudioやAzureからAzure DevOpsを使うVisual StudioやAzureからAzure DevOpsを使う
Visual StudioやAzureからAzure DevOpsを使う
 
Tekton 入門
Tekton 入門Tekton 入門
Tekton 入門
 
Azure DevOps Online Vol.3 - Inside Azure Pipelines
Azure DevOps Online Vol.3 - Inside Azure PipelinesAzure DevOps Online Vol.3 - Inside Azure Pipelines
Azure DevOps Online Vol.3 - Inside Azure Pipelines
 
S07 Azure バックアップを利用したオンプレミス Windows Server のバックアップ
S07 Azure バックアップを利用したオンプレミス Windows Server のバックアップS07 Azure バックアップを利用したオンプレミス Windows Server のバックアップ
S07 Azure バックアップを利用したオンプレミス Windows Server のバックアップ
 
Logic Apps/Flow Update Summary
Logic Apps/Flow Update SummaryLogic Apps/Flow Update Summary
Logic Apps/Flow Update Summary
 
20190731 Azure Functions x Line at Azure Tech Lab #4
20190731 Azure Functions x Line at Azure Tech Lab #420190731 Azure Functions x Line at Azure Tech Lab #4
20190731 Azure Functions x Line at Azure Tech Lab #4
 
Interactive connection2
Interactive connection2Interactive connection2
Interactive connection2
 
Alfresco CI
Alfresco CIAlfresco CI
Alfresco CI
 
NET MAUI for .NET 7 for iOS, Android app development
 NET MAUI for .NET 7 for iOS, Android app development  NET MAUI for .NET 7 for iOS, Android app development
NET MAUI for .NET 7 for iOS, Android app development
 
Ec cube開発合宿 プラグインセミナー
Ec cube開発合宿 プラグインセミナーEc cube開発合宿 プラグインセミナー
Ec cube開発合宿 プラグインセミナー
 
はてなにおける継続的デプロイメントの現状と Docker の導入
はてなにおける継続的デプロイメントの現状と Docker の導入はてなにおける継続的デプロイメントの現状と Docker の導入
はてなにおける継続的デプロイメントの現状と Docker の導入
 
[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送
[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送
[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送
 
Flex's DI Container
Flex's DI ContainerFlex's DI Container
Flex's DI Container
 
環境構築自動化ツールのご紹介
環境構築自動化ツールのご紹介環境構築自動化ツールのご紹介
環境構築自動化ツールのご紹介
 
LabVIEW NXG Web Module Training Slide
LabVIEW NXG Web Module Training SlideLabVIEW NXG Web Module Training Slide
LabVIEW NXG Web Module Training Slide
 
Tech talk salesforce mobile sdk
Tech talk   salesforce mobile sdkTech talk   salesforce mobile sdk
Tech talk salesforce mobile sdk
 
Whats service mesh & istio ?
Whats service mesh & istio ?Whats service mesh & istio ?
Whats service mesh & istio ?
 
2021/03/19 パブリッククラウドを活かす運用プロセス自動化
2021/03/19 パブリッククラウドを活かす運用プロセス自動化2021/03/19 パブリッククラウドを活かす運用プロセス自動化
2021/03/19 パブリッククラウドを活かす運用プロセス自動化
 
エンプラに Kubernetes を 導入してみて分かった 4つの Lessons Learned
エンプラに Kubernetes を 導入してみて分かった 4つの Lessons Learnedエンプラに Kubernetes を 導入してみて分かった 4つの Lessons Learned
エンプラに Kubernetes を 導入してみて分かった 4つの Lessons Learned
 

More from Yusuke Kita

Integrating libSyntax into the compiler pipeline
Integrating libSyntax into the compiler pipelineIntegrating libSyntax into the compiler pipeline
Integrating libSyntax into the compiler pipeline
Yusuke Kita
 
Making your own tool using SwiftSyntax
Making your own tool using SwiftSyntaxMaking your own tool using SwiftSyntax
Making your own tool using SwiftSyntax
Yusuke Kita
 
[Deprecated] Integrating libSyntax into the compiler pipeline
[Deprecated] Integrating libSyntax into the compiler pipeline[Deprecated] Integrating libSyntax into the compiler pipeline
[Deprecated] Integrating libSyntax into the compiler pipeline
Yusuke Kita
 
Creating your own Bitrise step
Creating your own Bitrise stepCreating your own Bitrise step
Creating your own Bitrise step
Yusuke Kita
 
Introducing swift-format
Introducing swift-formatIntroducing swift-format
Introducing swift-format
Yusuke Kita
 
Unidirectional Data Flow Through SwiftUI
Unidirectional Data Flow Through SwiftUIUnidirectional Data Flow Through SwiftUI
Unidirectional Data Flow Through SwiftUI
Yusuke Kita
 
Open Source Swift Workshop
Open Source Swift WorkshopOpen Source Swift Workshop
Open Source Swift Workshop
Yusuke Kita
 
Contributing to Swift Compiler
Contributing to Swift CompilerContributing to Swift Compiler
Contributing to Swift Compiler
Yusuke Kita
 
Writing a compiler in go
Writing a compiler in goWriting a compiler in go
Writing a compiler in go
Yusuke Kita
 
Writing an interpreter in swift
Writing an interpreter in swiftWriting an interpreter in swift
Writing an interpreter in swift
Yusuke Kita
 
SIL Optimizations - AllocBoxToStack
SIL Optimizations - AllocBoxToStackSIL Optimizations - AllocBoxToStack
SIL Optimizations - AllocBoxToStack
Yusuke Kita
 
SIL for First Time Learners
SIL for First Time LearnersSIL for First Time Learners
SIL for First Time Learners
Yusuke Kita
 
var, let in SIL
var, let in SILvar, let in SIL
var, let in SIL
Yusuke Kita
 
SIL for First Time Leaners LT
SIL for First Time Leaners LTSIL for First Time Leaners LT
SIL for First Time Leaners LT
Yusuke Kita
 
How to try! Swift
How to try! SwiftHow to try! Swift
How to try! Swift
Yusuke Kita
 
SIL for the first time
SIL for the first timeSIL for the first time
SIL for the first time
Yusuke Kita
 
Introducing protobuf in Swift
Introducing protobuf in SwiftIntroducing protobuf in Swift
Introducing protobuf in Swift
Yusuke Kita
 
Type-safe Web APIs with Protocol Buffers in Swift at AltConf
Type-safe Web APIs with Protocol Buffers in Swift at AltConfType-safe Web APIs with Protocol Buffers in Swift at AltConf
Type-safe Web APIs with Protocol Buffers in Swift at AltConf
Yusuke Kita
 
Type-safe Web APIs with Protocol Buffers in Swift at iOSCon
Type-safe Web APIs with Protocol Buffers in Swift at iOSConType-safe Web APIs with Protocol Buffers in Swift at iOSCon
Type-safe Web APIs with Protocol Buffers in Swift at iOSCon
Yusuke Kita
 

More from Yusuke Kita (19)

Integrating libSyntax into the compiler pipeline
Integrating libSyntax into the compiler pipelineIntegrating libSyntax into the compiler pipeline
Integrating libSyntax into the compiler pipeline
 
Making your own tool using SwiftSyntax
Making your own tool using SwiftSyntaxMaking your own tool using SwiftSyntax
Making your own tool using SwiftSyntax
 
[Deprecated] Integrating libSyntax into the compiler pipeline
[Deprecated] Integrating libSyntax into the compiler pipeline[Deprecated] Integrating libSyntax into the compiler pipeline
[Deprecated] Integrating libSyntax into the compiler pipeline
 
Creating your own Bitrise step
Creating your own Bitrise stepCreating your own Bitrise step
Creating your own Bitrise step
 
Introducing swift-format
Introducing swift-formatIntroducing swift-format
Introducing swift-format
 
Unidirectional Data Flow Through SwiftUI
Unidirectional Data Flow Through SwiftUIUnidirectional Data Flow Through SwiftUI
Unidirectional Data Flow Through SwiftUI
 
Open Source Swift Workshop
Open Source Swift WorkshopOpen Source Swift Workshop
Open Source Swift Workshop
 
Contributing to Swift Compiler
Contributing to Swift CompilerContributing to Swift Compiler
Contributing to Swift Compiler
 
Writing a compiler in go
Writing a compiler in goWriting a compiler in go
Writing a compiler in go
 
Writing an interpreter in swift
Writing an interpreter in swiftWriting an interpreter in swift
Writing an interpreter in swift
 
SIL Optimizations - AllocBoxToStack
SIL Optimizations - AllocBoxToStackSIL Optimizations - AllocBoxToStack
SIL Optimizations - AllocBoxToStack
 
SIL for First Time Learners
SIL for First Time LearnersSIL for First Time Learners
SIL for First Time Learners
 
var, let in SIL
var, let in SILvar, let in SIL
var, let in SIL
 
SIL for First Time Leaners LT
SIL for First Time Leaners LTSIL for First Time Leaners LT
SIL for First Time Leaners LT
 
How to try! Swift
How to try! SwiftHow to try! Swift
How to try! Swift
 
SIL for the first time
SIL for the first timeSIL for the first time
SIL for the first time
 
Introducing protobuf in Swift
Introducing protobuf in SwiftIntroducing protobuf in Swift
Introducing protobuf in Swift
 
Type-safe Web APIs with Protocol Buffers in Swift at AltConf
Type-safe Web APIs with Protocol Buffers in Swift at AltConfType-safe Web APIs with Protocol Buffers in Swift at AltConf
Type-safe Web APIs with Protocol Buffers in Swift at AltConf
 
Type-safe Web APIs with Protocol Buffers in Swift at iOSCon
Type-safe Web APIs with Protocol Buffers in Swift at iOSConType-safe Web APIs with Protocol Buffers in Swift at iOSCon
Type-safe Web APIs with Protocol Buffers in Swift at iOSCon
 

Share Extension@pixiv