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.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
[JAWS DAYS 2025] 最近の DB の競合解決の仕組みが分かった気になってみた
maroon1st
0
130
パスキーのすべて ── 導入・UX設計・実装の紹介 / 20250213 パスキー開発者の集い
kuralab
3
910
良いコードレビューとは
danimal141
1
260
メンテが命: PHPフレームワークのコンテナ化とアップグレード戦略
shunta27
0
310
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
160
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1.2k
もう僕は OpenAPI を書きたくない
sgash708
6
1.9k
機能が複雑化しても 頼りになる FactoryBotの話
tamikof
1
220
責務と認知負荷を整える! 抽象レベルを意識した関心の分離
yahiru
8
1.5k
「個人開発マネタイズ大全」が教えてくれたこと
bani24884
1
260
データの整合性を保つ非同期処理アーキテクチャパターン / Async Architecture Patterns
mokuo
55
19k
SwiftUI移行のためのインプレッショントラッキング基盤の構築
kokihirokawa
0
160
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
94
13k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
Navigating Team Friction
lara
183
15k
A better future with KSS
kneath
238
17k
Gamification - CAS2011
davidbonilla
80
5.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
GitHub's CSS Performance
jonrohan
1030
460k
Building Adaptive Systems
keathley
40
2.4k
A Tale of Four Properties
chriscoyier
158
23k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
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