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
890
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.4k
dSYMのアップロードで SPMを活用する/use_spm_with_upload_dsyms
fromkk
1
2.6k
Bitriseのリモートアクセス機能 #bitrise_meetup/remote_access_of_bitrise
fromkk
1
520
note社でのMagic Pod活用事例 #af_iosdc/magicpod_with_note
fromkk
2
10k
iOSには無いmacOS独自機能をCatalystで実装する #iosdc #d/make_macos_apps_with_catalyst
fromkk
9
2k
Other Decks in Programming
See All in Programming
Jakarta EE meets AI
ivargrimstad
0
150
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
CSC509 Lecture 09
javiergs
PRO
0
140
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
Macとオーディオ再生 2024/11/02
yusukeito
0
370
初めてDefinitelyTypedにPRを出した話
syumai
0
410
Featured
See All Featured
Gamification - CAS2011
davidbonilla
80
5k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Building Your Own Lightsaber
phodgson
103
6.1k
Adopting Sorbet at Scale
ufuk
73
9.1k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Producing Creativity
orderedlist
PRO
341
39k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Music & Morning Musume
bryan
46
6.2k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
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