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
文字列をコピーできるスクリーンショットを作る/iOSDC 2020 LT PDF
Search
M"e
September 20, 2020
Technology
3
4.8k
文字列をコピーできるスクリーンショットを作る/iOSDC 2020 LT PDF
M"e
September 20, 2020
Tweet
Share
More Decks by M"e
See All by M"e
Hapticをカスタマイズしてみよう / ZOZO Tech Talk #6 Customize Haptic
endoumari
0
1.9k
UIViewで光の三原色の混ざり合いを表現したい / potatotips 75 Blend Mode
endoumari
1
300
ZOZOが採用しているiOSのアーキテクチャについて/zozo-tech-meetup8-ios-architecture
endoumari
0
2.4k
Dribbbleで見つけたコンセプトデザインを実装/potatotips-56-concept-design
endoumari
2
650
iOSエンジニアが悩んだUpボタンについて / 2017 potatotips 45 Up Button
endoumari
1
1.1k
URLエンコードされた Shift_JISのデコードについて / iOSDC 2017 LT SJIS decode
endoumari
1
4.9k
Other Decks in Technology
See All in Technology
いまならこう作りたい AWSコンテナ[本格]入門ハンズオン 〜2024年版 ハンズオンの構想〜
horsewin
9
2.1k
Vueで Webコンポーネントを作って Reactで使う / 20241030-cloudsign-vuefes_after_night
bengo4com
4
2.5k
プロダクトエンジニアが活躍する環境を作りたくて 事業責任者になった話 ~プロダクトエンジニアの行き着く先~
gimupop
1
460
AWS re:Inventを徹底的に楽しむためのTips / Tips for thoroughly enjoying AWS re:Invent
yuj1osm
1
560
10分でわかるfreeeのQA
freee
1
3.4k
MAMを軸とした動画ハンドリングにおけるAI活用前提の整備と次世代ビジョン / abema-ai-mam
cyberagentdevelopers
PRO
1
110
Jr. Championsになって、強く連携しながらAWSをもっと使いたい!~AWSに対する期待と行動~
amixedcolor
0
190
分布で見る効果検証入門 / ai-distributional-effect
cyberagentdevelopers
PRO
4
690
AWSコンテナ本出版から3年経った今、もし改めて執筆し直すなら / If I revise our container book
iselegant
15
3.9k
Shift-from-React-to-Vue
calm1205
3
1.3k
ABEMA のコンテンツ制作を最適化!生成 AI x クラウド映像編集システム / abema-ai-editor
cyberagentdevelopers
PRO
1
180
初心者に Vue.js を 教えるには
tsukuha
5
390
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.6k
Scaling GitHub
holman
458
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
32
1.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
The Invisible Side of Design
smashingmag
297
50k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Unsuck your backbone
ammeep
668
57k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Building Adaptive Systems
keathley
38
2.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.8k
Into the Great Unknown - MozCon
thekraken
31
1.5k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Transcript
จࣈྻΛίϐʔͰ͖Δ εΫϦʔϯγϣοτΛ࡞Δ גࣜձࣾZOZOςΫϊϩδʔζ ZOZOTOWN෦ ͑ΜͲ͏ Copyright © ZOZO Technologies, Inc.
© ZOZO Technologies, Inc. גࣜձࣾZOZOςΫϊϩδʔζ ZOZOTOWN෦ ͑ΜͲ͏ ▶ ZOZOTOWN /
iOSΞϓϦ։ൃ ▶ Twitter: re___you 2
© ZOZO Technologies, Inc. ͝ଘͰ͠ΐ͏͔ʁ 3
© ZOZO Technologies, Inc. 4 ͝ଘͰ͠ΐ͏͔ʁ - iOS 13͔ΒϑϧϖʔδͷεΫϦʔϯγϣοτ͕Մೳʹʂ
© ZOZO Technologies, Inc. 5 - iOS 13͔ΒϑϧϖʔδͷεΫϦʔϯγϣοτ͕Մೳʹʂ - αʔυύʔςΟΞϓϦରԠͰ͖Δ
͝ଘͰ͠ΐ͏͔ʁ
© ZOZO Technologies, Inc. 6 - iOS 13͔ΒϑϧϖʔδͷεΫϦʔϯγϣοτ͕Մೳʹʂ - αʔυύʔςΟΞϓϦରԠͰ͖Δ
- อଘܗࣜPDF ͝ଘͰ͠ΐ͏͔ʁ
© ZOZO Technologies, Inc. 7 εΫϦʔϯγϣοτͰจࣈΛ ίϐʔݕࡧͰ͖Δɻ ͦ͏ɺPDFͳΒͶɻ
© ZOZO Technologies, Inc. 8 ͦ͏ɺPDFͳΒͶ SafariͷϑϧϖʔδεΫϦʔϯγϣοτͰ จࣈྻͷίϐʔ&ݕࡧ͕Ͱ͖Δ
© ZOZO Technologies, Inc. 9
© ZOZO Technologies, Inc. 10 จࣈͷίϐʔ͕ Ͱ͖ͳ͍
© ZOZO Technologies, Inc. 11 จࣈΛίϐʔͰ͖ͳ͍ PDFͨͩͷը૾ͩ
© ZOZO Technologies, Inc. 12 ࠓ͢͜ͱ - ͳͥPDFจࣈྻΛίϐʔͰ͖Δͷ͔ʁ - ͳͥจࣈྻΛίϐʔͰ͖ͳ͔ͬͨͷ͔ʁ
- จࣈྻΛίϐʔͰ͖ΔPDFΛ࡞Δʹʁ
© ZOZO Technologies, Inc. 13 ࠓ͞ͳ͍͜ͱ - ϑϧϖʔδͷεΫϦʔϯγϣοτͷ࡞ʹ͍ͭͯ - TECH
BLOGʹߘ͍ͯ͠·͢ https://techblog.zozo.com/entry/ios_fullpage_screenshot
© ZOZO Technologies, Inc. ͳͥPDFจࣈྻΛ ίϐʔͰ͖Δͷ͔ʁ 14 Episode 1.
© ZOZO Technologies, Inc. 15 PDF จࣈใΛ͍࣋ͬͯΔ
© ZOZO Technologies, Inc. 16 PDFͷจࣈͷඳը จࣈใ
© ZOZO Technologies, Inc. 17 PDFͷத
© ZOZO Technologies, Inc. 18 PDFͷத
© ZOZO Technologies, Inc. 19 PDFͷத
© ZOZO Technologies, Inc. ͳͥจࣈྻΛ ίϐʔͰ͖ͳ͔ͬͨͷ͔ʁ 20 Episode 2.
© ZOZO Technologies, Inc. 21 จࣈใΛ ͍࣋ͬͯͳ͔ͬͨ
© ZOZO Technologies, Inc. 22 จࣈྻΛίϐʔͰ͖ͳ͍PDF ը૾ ը૾ ը૾ ը૾
© ZOZO Technologies, Inc. 23 จࣈྻΛίϐʔͰ͖ͳ͍PDF ը૾ ը૾ ը૾ ը૾
จࣈը૾ʹͳ͍ͬͯͨ
© ZOZO Technologies, Inc. 24 จࣈྻΛίϐʔͰ͖ͳ͍PDF ը૾ ը૾ ը૾ ը૾
ͳͥͳͷ͔ʁ
© ZOZO Technologies, Inc. iOSͷඳըʹ͍ͭͯ 25 - iOScontextʹΑͬͯඳըܗ͕ࣜมΘΔ - PDFContext
→ PDF - ImageContext → ը૾ https://developer.apple.com/library/archive/documentation/ GraphicsImaging/Conceptual/drawingwithquartz2d/dq_overview/ dq_overview.html
© ZOZO Technologies, Inc. 26 iOSͷඳըʹ͍ͭͯ PDFContextʹඳը͢Ε ͍͍ײ͡ʹͳΔͱࢥ͍ͬͯͨ
© ZOZO Technologies, Inc. 27 let renderer = UIGraphicsPDFRenderer(bounds: view.bounds)
let data = renderer.pdfData { context in context.beginPage() view.layer.render(in: context.cgContext) } UIGraphicsEndPDFContext() ίʔυΛݟͯ͠ΈΔ
© ZOZO Technologies, Inc. 28 let renderer = UIGraphicsPDFRenderer(bounds: view.bounds)
let data = renderer.pdfData { context in context.beginPage() view.layer.render(in: context.cgContext) } UIGraphicsEndPDFContext() ίʔυΛݟͯ͠ΈΔ ո͍͠
© ZOZO Technologies, Inc. 29 view.layer.render ԿΛඳը͍ͯ͠Δͷ͔ʁ
© ZOZO Technologies, Inc. 30 view.layer.render UIViewͷίϯςϯπͷ ϏοτϚοϓΛඳը͍ͯ͠Δ
© ZOZO Technologies, Inc. 31 UIViewͱCALayerͷؔ CALayer PDFContext drawRect render
ίϐʔͰ͖ͳ͍ PDF BitmapContext ϏοτϚοϓ UIView
© ZOZO Technologies, Inc. จࣈྻΛίϐʔͰ͖Δ PDFΛ࡞Δʹʁ 32 Episode 3.
© ZOZO Technologies, Inc. 33 ViewΛඳը͢Δ
© ZOZO Technologies, Inc. 34 UIView CALayer PDFContext drawRect render
ίϐʔͰ͖ͳ͍ PDF BitmapContext ϏοτϚοϓ PDFContext ίϐʔͰ͖Δ PDF viewΛඳը͢Δ
© ZOZO Technologies, Inc. 35 let renderer = UIGraphicsPDFRenderer(bounds: view.bounds)
let data = renderer.pdfData { context in context.beginPage() view.layer.render(in: context.cgContext) } UIGraphicsEndPDFContext() viewΛඳը͢Δ
© ZOZO Technologies, Inc. 36 let renderer = UIGraphicsPDFRenderer(bounds: view.bounds)
let data = renderer.pdfData { context in context.beginPage() view.draw(view.bounds) } UIGraphicsEndPDFContext() viewΛඳը͢Δ
© ZOZO Technologies, Inc. 37
© ZOZO Technologies, Inc. Կඳը͞Εͳ͍
© ZOZO Technologies, Inc. 39 let renderer = UIGraphicsPDFRenderer(bounds: view.bounds)
let data = renderer.pdfData { context in context.beginPage() view.draw(view.bounds) } UIGraphicsEndPDFContext() viewΛඳը͢Δ
© ZOZO Technologies, Inc. 40 let renderer = UIGraphicsPDFRenderer(bounds: view.bounds)
let data = renderer.pdfData { context in context.beginPage() view.subviews.forEach { $0.draw($0.bounds) } } UIGraphicsEndPDFContext() viewΛඳը͢Δ
© ZOZO Technologies, Inc. 41
© ZOZO Technologies, Inc. ϨΠΞτ͕ ࠨ্ʹີͰ͢
© ZOZO Technologies, Inc. 43 view.layer.render ϨΠΞτ എܠͷඳը ಁաॲཧ Ϙʔμͷඳը
AspectFill ରԠ
© ZOZO Technologies, Inc. 44 ͋ͱ࣮͢Δ͚ͩ
© ZOZO Technologies, Inc. 45
© ZOZO Technologies, Inc. 46 ৄ͍࣮͠GitHub https://github.com/EndouMari/ SampleScreenshot
None