Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ShareExtensionをためす
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
320
モバイルアプリ開発チームをプラットフォームチームで分割した話
shoheifukui
0
610
iOSアプリの 大きな技術的負債に立ち向かう
shoheifukui
1
1.3k
モバイルアプリでのFeatureFlagの導入
shoheifukui
0
680
Other Decks in Programming
See All in Programming
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
260
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
130
ふつうのFeature Flag実践入門
irof
8
4.1k
エージェンティックRAGにAWSで入門しよう!
har1101
9
1.7k
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
220
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
130
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
210
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
2
590
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
7k
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
290
Inside Stream API
skrb
1
760
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.2k
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
260
How to Talk to Developers About Accessibility
jct
2
240
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
170
Embracing the Ebb and Flow
colly
88
5.1k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.1k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
240
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
400
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
580
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
330
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Λ͏߹
ԿͰͰ͖ΔͷͰׂѪ
Ҏ্