Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ShareExtensionをためす
Search
tinpay
November 11, 2014
Programming
1.8k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ShareExtensionをためす
ためしてみた。
tinpay
November 11, 2014
More Decks by tinpay
See All by tinpay
レガシーなiOSアプリのSwift化 〜5年分の成功と失敗事例〜
shoheifukui
0
330
モバイルアプリ開発チームをプラットフォームチームで分割した話
shoheifukui
0
660
iOSアプリの 大きな技術的負債に立ち向かう
shoheifukui
1
1.4k
モバイルアプリでのFeatureFlagの導入
shoheifukui
0
700
Other Decks in Programming
See All in Programming
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
600
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
250
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
200
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
350
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
4
800
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
160
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
510
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
340
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
190
Workers Cache を知る
syumai
0
230
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
360
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
8.3k
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Scaling GitHub
holman
464
140k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
880
A Modern Web Designer's Workflow
chriscoyier
699
190k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
830
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
520
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
340
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
260
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Building an army of robots
kneath
307
46k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Transcript
4IBSF&YUFOTJPO Λࢼͯ͠ΈΔ ϞόΠϧΞϓϦ ษڧձ 99Ҫষฏ
ΞδΣϯμ w 4IBSF&YUFOTJPOͱ w छྨͷ4IBSF&YUFOTJPO 4-$PNQPTF4FSWJDF7JFX$POUSPMMFSΛར༻ 6*7JFX$POUSPMMFSΛར༻
4IBSF&YUFOTJPOͱ
ྫ͑ 4BGBSJ ԼͷਅΜதͷ ϘλϯΛԡ͢
ՃͰ͖Δ
5XJUUFSͷ4IBSF&YUFOTJPO
&WFSOPUFͷ4IBSF&YUFOTJPO
1JOUFSFTUͷ4IBSF&YUFOTJPO
1PDLFUͷ4IBSF&YUFOTJPO
छྨͷ 4IBSF&YUFOTJPO
4-$PNQPTF4FSWJDF7JFX$POUSPMMFS ൚༻తͳ6* 6*෦ͷ࣮͕΄΅ෆཁɻ ؆୯ʹ࣮Ͱ͖Δɻ
6*7JFX$POUSPMMFS ࣗ༝ͷߴ͍6* 6*ɺը໘ભҠɺͯ͢ ಠࣗͰ࣮͢Δඞཁ͕ ͋Δɻ
࡞ͬͯΈΔ
ϓϩδΣΫτ ίϯςφʔΞϓϦ Λͭ͘Δ
5BSHFUΛՃ͢Δ
5BSHFUΛՃ͢Δ import UIKit import Social ! class ShareViewController: SLComposeServiceViewController {
! override func isContentValid() -> Bool { return true } ! override func didSelectPost() { self.extensionContext!.completeRequestReturningItems([], completionHandler: nil) } ! override func configurationItems() -> [AnyObject]! { return NSArray() } ! } 4IBSF7JFX$POUSPMMFSTXJGU όϦσʔγϣϯ ߘϘλϯλοϓ࣌ DPOpHVSBUJPOΞΠςϜͷઃఆ
Ұ࣮ߦͯ͠ΈΔ
$POpHVSBUJPOΞΠςϜͷՃ override func configurationItems() -> [AnyObject]! { var configurationItem :
SLComposeSheetConfigurationItem = SLComposeSheetConfigurationItem() //λΠτϧ configurationItem.title = "ϧʔϜ" //બ͞Ε͍ͯΔϧʔϜ໊ configurationItem.value = "ϚΠνϟοτ"; configurationItem.tapHandler = { [unowned self] in var storyboard : UIStoryboard = UIStoryboard(name: "SelectRoom",bundle: nil) // var vc : SelectRoomTableViewController = storyboard.instantiateInitialViewController() as SelectRoomTableViewController // self.pushConfigurationViewController(vc) } return [configurationItem] } 4IBSF7JFX$POUSPMMFSTXJGU
$POpHVSBUJPOΞΠςϜͷՃ
#BSͷ৭ͷΧελϚΠζ override func viewDidLoad() { super.viewDidLoad() self.navigationController?.navigationBar.backgroundColor = UIColor.redColor() self.navigationController?.navigationBar.tintColor
= UIColor.whiteColor() } 4IBSF7JFX$POUSPMMFSTXJGU
#BSͷ৭ͷΧελϚΠζ
ೖྗνΣοΫ override func isContentValid() -> Bool { if(self.contentText.isEmpty){ return false
} return true } 4IBSF7JFX$POUSPMMFSTXJGU
ೖྗνΣοΫ
4IBSF͢Δ 4IBSF7JFX$POUSPMMFSTXJGU override func didSelectPost() { var inputItem : NSExtensionItem
= self.extensionContext!.inputItems[0] as NSExtensionItem var outputItem : NSExtensionItem = inputItem.copy() as NSExtensionItem; var itemProvider : NSItemProvider = inputItem.attachments![0] as NSItemProvider if (itemProvider.hasItemConformingToTypeIdentifier("public.url")) { itemProvider.loadItemForTypeIdentifier("public.url", options: nil, completionHandler: { (urlItem, error) in if (error != nil) { println("Unable to add as a URL") //Τϥʔ༰ΛϗετΞϓϦʹ͑Δ self.extensionContext!.cancelRequestWithError(error) } else if let url = urlItem as? NSURL { //ೖྗ͞ΕͨςΩετΛઃఆ͢Δ outputItem.attributedContentText = NSAttributedString(string:self.contentText, attributes:nil); //࣮Λ͔͘ //࣮ࡍʹߘͨ͠ΞΠςϜΛϗετΞϓϦʹ͑Δ self.extensionContext!.completeRequestReturningItems([outputItem], completionHandler: nil) } }) } }
ίϯςφʔΞϓϦͱ4IBSF&YUFOTJPOͷ σʔλڞ༗ w ίϯςφΞϓϦͱ&YUFOTJPOͱผͷλʔήοτͳ ͷͰɺ૬ޓͷσʔλΛࢀর͢Δ͜ͱͰ͖ͳ͍ w ,FZDIBJOͷ߹,FZDIBJO4IBSJOHͱ͍͏ڞ༗ํ ๏͕͋Δɻ $PSF%BUBͷ߹"QQ(SPVQͰσʔλڞ༗Ͱ͖ Δɻ
,FZDIBJO4IBSJOH
,FZDIBJO4IBSJOH
ίϯςφʔΞϓϦͰ,FZDIBJOొ UICKeyChainStore.setString("xx0123456789xx", forKey: "accessToken" , service: "chat", accessGroup: "com.chatwork.inhouse.hogehogehoge") 7JFX$POUSPMMFSTXJGU
&YUFOTJPOͰݺͼग़͠ //ೖྗ͞ΕͨςΩετΛઃఆ͢Δ outputItem.attributedContentText = NSAttributedString(string:self.contentText, attributes:nil); //࣮Λ͔͘ var token:String =
UICKeyChainStore.stringForKey("accessToken", service: "chat", accessGroup: "com.chatwork.inhouse.hogehogehoge") ! //࣮ࡍʹߘͨ͠ΞΠςϜΛϗετΞϓϦʹ͑Δ self.extensionContext!.completeRequestReturningItems([outputItem], completionHandler: nil) 4IBSF7JFX$POUSPMMFSTXJGU
6*7JFX$POUSPMMFSΛ͏߹
ԿͰͰ͖ΔͷͰׂѪ
Ҏ্