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
930
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.6k
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
Rubyと自由とAIと
yotii23
6
1.9k
Boos Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
580
CloudRun, Spanner に対する負荷試験の反省と オブザーバビリティによるアプローチ
oyasumipants
1
150
DRFを少しずつ オニオンアーキテクチャに寄せていく DjangoCongress JP 2025
nealle
2
290
クックパッド検索システム統合/Cookpad Search System Consolidation
giga811
0
130
バッチを作らなきゃとなったときに考えること
irof
2
550
From the Wild into the Clouds - Laravel Meetup Talk
neverything
0
180
GoとPHPのインターフェイスの違い
shimabox
2
210
ナレッジイネイブリングにAIを活用してみる ゆるSRE勉強会 #9
nealle
0
170
AIプログラミング雑キャッチアップ
yuheinakasaka
19
5k
sappoRo.R #12 初心者セッション
kosugitti
0
280
良いコードレビューとは
danimal141
9
6k
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Building Adaptive Systems
keathley
40
2.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Into the Great Unknown - MozCon
thekraken
35
1.6k
It's Worth the Effort
3n
184
28k
Faster Mobile Websites
deanohume
306
31k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Mobile First: as difficult as doing things right
swwweet
223
9.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
10
530
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
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