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.2k
URLエンコードされた Shift_JISのデコードについて / iOSDC 2017 LT SJIS decode
endoumari
1
5k
Other Decks in Technology
See All in Technology
SSMRunbook作成の勘所_20241120
koichiotomo
2
130
OCI Vault 概要
oracle4engineer
PRO
0
9.7k
フルカイテン株式会社 採用資料
fullkaiten
0
40k
第1回 国土交通省 データコンペ参加者向け勉強会③- Snowflake x estie編 -
estie
0
130
強いチームと開発生産性
onk
PRO
34
11k
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
180
いざ、BSC討伐の旅
nikinusu
2
780
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.8k
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
580
Platform Engineering for Software Developers and Architects
syntasso
1
510
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
Featured
See All Featured
Writing Fast Ruby
sferik
627
61k
The World Runs on Bad Software
bkeepers
PRO
65
11k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Building an army of robots
kneath
302
43k
Building Your Own Lightsaber
phodgson
103
6.1k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
Being A Developer After 40
akosma
86
590k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
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