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
920
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
550
note社でのMagic Pod活用事例 #af_iosdc/magicpod_with_note
fromkk
2
11k
iOSには無いmacOS独自機能をCatalystで実装する #iosdc #d/make_macos_apps_with_catalyst
fromkk
9
2.1k
Other Decks in Programming
See All in Programming
SwiftUIで単方向アーキテクチャを導入して得られた成果
takuyaosawa
0
260
Formの複雑さに立ち向かう
bmthd
1
720
[JAWS-UG横浜 #80] うわっ…今年のServerless アップデート、少なすぎ…?
maroon1st
1
170
チームリードになって変わったこと
isaka1022
0
190
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
0
180
テストをしないQAエンジニアは何をしているか?
nealle
0
130
Domain-Driven Transformation
hschwentner
2
1.9k
ARA Ansible for the teams
kksat
0
150
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
1
140
Multi Step Form, Decentralized Autonomous Organization
pumpkiinbell
1
660
Rails アプリ地図考 Flush Cut
makicamel
1
110
XStateを用いた堅牢なReact Components設計~複雑なClient Stateをシンプルに~ @React Tokyo ミートアップ #2
kfurusho
1
770
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
6
240
Six Lessons from altMBA
skipperchong
27
3.6k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
114
50k
Code Review Best Practice
trishagee
66
17k
Fireside Chat
paigeccino
34
3.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Embracing the Ebb and Flow
colly
84
4.6k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.4k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
A Philosophy of Restraint
colly
203
16k
The Language of Interfaces
destraynor
156
24k
We Have a Design System, Now What?
morganepeng
51
7.4k
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