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
# Type にDrag and Dropの実装をしてみた/type_with_drag_an...
Search
fromkk
June 21, 2017
Programming
0
2.9k
# Type にDrag and Dropの実装をしてみた/type_with_drag_and_drop
# Type にDrag and Dropの実装をしてみた
fromkk
June 21, 2017
Tweet
Share
More Decks by fromkk
See All by fromkk
note社の全員野球で品質向上活動について / note_qa_challenge #iOS_test_teatime
fromkk
3
1.8k
1年分のデータが見たいと言われてやったこと/yearly_data_with_note
fromkk
0
910
note iOSチームの自動化 ver.2021/automation_with_iOS_team_on_note_ver2021
fromkk
0
1.9k
Bitrise体験会説明資料/bitrise_explore
fromkk
1
1k
noteのiOSアプリで実装したアクセシビリティの全て #iosdc #a /a11y_with_iOS_App_on_note
fromkk
2
3.5k
dSYMのアップロードで SPMを活用する/use_spm_with_upload_dsyms
fromkk
1
2.7k
Bitriseのリモートアクセス機能 #bitrise_meetup/remote_access_of_bitrise
fromkk
1
530
note社でのMagic Pod活用事例 #af_iosdc/magicpod_with_note
fromkk
2
11k
iOSには無いmacOS独自機能をCatalystで実装する #iosdc #d/make_macos_apps_with_catalyst
fromkk
9
2k
Other Decks in Programming
See All in Programming
情報漏洩させないための設計
kubotak
5
1.3k
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
190
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
Package Traits
ikesyo
1
200
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
0
2.1k
Beyond ORM
77web
11
1.6k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
430
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
390
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
1.7k
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
160
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
420
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
1.4k
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
It's Worth the Effort
3n
183
28k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
500
4 Signs Your Business is Dying
shpigford
182
22k
Docker and Python
trallard
43
3.2k
Code Reviewing Like a Champion
maltzj
521
39k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Scaling GitHub
holman
459
140k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
The World Runs on Bad Software
bkeepers
PRO
66
11k
Transcript
# Type ʹDrag and Dropͷ࣮Λͯ͠Έͨ WWDC After Party 2017 @Ebisu
1
Profile Kazuya Ueoka Timers inc.ͷiOSΤϯδχΞ Twitter: @fromkk Github: fromkk Qiita:
fromkk 2
WWDC 2017ʹߦͬͯདྷ·ͨ͠✈ ϒϩά͍͔ͭ͘ॻ͍ͨͷͰΑ͔ͬͨΒ؍ͯͶ! http://techblog.timers-inc.com/archive/category/wwdc2017 3
ܰ͘ৼΓฦΓ • iMac Pro/iPad Pro 10.5Πϯν/HomePodͷ৽ • iMac/Macbook ProͷΞοϓάϨʔυ •
CoreML/Vision/ARKit/VRKitͷ৽ٕज़ • CoreNFC/Music Kit৽APIͷղ์ • iOS 11/tvOS 11/watchOS 4/macOS High Sierra • etc... 4
Drag and Dropؔ࿈ηογϣϯ • 203 Introducing Drag and Drop •
223 Drag and Drop with Collection and Table View • 227 Data Delivery with Drag and Drop 5
ԿނDrag and DropରԠͳͷ͔ • ❌ iMac Proख͕ग़ͤͳ͍ • ❌ HomePodདྷҎ߱ʹͳΒͳ͍ͱຊͰൃച͠ͳ͍
• ⭕ iPad Proલ͔Βཉ͔ͬͨ͠ • ⭕ αΠζมΘΒͣϕθϧ͕ࡉ͘ͳΔ͚ͩͱ͔࠷ߴ↗ • ⭕ ৽͍͠Έͩ͠ࢼͯ͠Έ͍ͨ‼ 6
ʊਓਓਓਓਓਓਓਓਓਓਓਓਓਓʊ ʼɹiPad Pro 10.5Πϯνങ͓͏ʻ ʉY^Y^Y^Y^Y^Y^Y^Y^Y^Yʉ (Keynote؍ऴΘͬͨΒͦͷ··จ) 7
ಧ͍ͨ 8
iPad Proಧ͍ͨʹͬͨࣄ • iOS 11 betaͷΠϯετʔϧ Ҏ্ 9
Typeͱ • iOSରԠͷγϯϓϧͰܰྔͳ MarkdownΤσΟλ • ؆୯ͳϓϨϏϡʔ/ࣗಈอଘ/ΩʔϘʔ υೖྗิॿ • 3Dλον/SpotlightରԠ •
Qiita/Github issue/GistͷߘରԠ • Realm Mobile PlatformΛར༻ͨ͠ಉ ظػೳ Type 10
Dragػೳͷར༻Օॴ • MarkdownҰཡը໘ 11
DragͷओཁΫϥε • UIDragInteraction • UIDragInteractionDelegate • UIDragItem(itemProvider: NSItemProvider) 12
Dragͷ࣮ํ๏ʢͦͷ1ʣ func addSupportDragInteractionIfNeeded() { if #available(iOS 11.0, *) { let
dragInteraction = UIDragInteraction(delegate: self) self.addInteraction(dragInteraction) } } 13
Dragͷ࣮ํ๏ʢͦͷ2ʣ @available (iOS 11.0, *) extension IndexViewCell: UIDragInteractionDelegate { func
dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] { let provider = NSItemProvider(object: self.article.markdown as NSString) let dragItem = UIDragItem(itemProvider: provider) return [dragItem] } } 14
Dropػೳͷར༻Օॴ • Markdownฤूը໘ 15
DropͷओཁΫϥε • UIDropInteraction • UIDropInteractionDelegate • UIDropProposal 16
Dropͷ࣮ํ๏(ͦͷ1) func addSupportDropInteractionIfNeeded() { if #available(iOS 11.0, *) { let
dropInteraction = UIDropInteraction(delegate: self) self.view.addInteraction(dropInteraction) } } 17
Dropͷ࣮ํ๏(ͦͷ2) @available(iOS 11.0, *) extension RegisterViewController: UIDropInteractionDelegate { func dropInteraction(_
interaction: UIDropInteraction, canHandle session: UIDropSession) -> Bool { return session.canLoadObjects(ofClasses: [UIImage.self]) } func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal { return UIDropProposal(operation: .copy) } func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) { session.loadObjects(ofClass: UIImage.self) { (items) in items.forEach({ (item) in guard let image: UIImage = item as? UIImage else { return } self.upload(image) }) } } } 18
Demo 19
·ͱΊ • DockͷଘࡏʹΑΓiPad͕ΑΓPCʹۙͮ͘ͷͰߋʹීٴ͕ݟ ࠐ·ΕΔ! • iPadରԠ΄΅ඞਢ͔⁉ • Drag and Drop࣮͢Δ͚ͩͳΒ͔ͳΓ؆୯#
• ৭ΜͳΞϓϦͱը໘্ͰϑΝΠϧͷΓͱΓग़དྷΔͷָ͍͠ ↗ 20
ͪͳΈʹ • TypeͷSwift 4ରԠແྃ͘͠·ͨ͠! • iOS 11͕ग़Δ·ͰϦϦʔεग़དྷͳ͍ͷ͕ͪԕ͍͠Ͱ͢" 21
͝੩ௌ༗͏͍͟͝·ͨ͠! 22