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
Using KSScreenshotManager
Search
Chuck Shnider
June 16, 2013
Programming
0
82
Using KSScreenshotManager
Slides from my talk at Ottawa Cocoaheads on March 14, 2013.
Chuck Shnider
June 16, 2013
Tweet
Share
More Decks by Chuck Shnider
See All by Chuck Shnider
A look back at GameDev on Apple II
chucks
0
490
Fun With Auto Layout
chucks
0
110
Introducing Skateway 2.0
chucks
0
39
Other Decks in Programming
See All in Programming
TiDB Serverless ~理想のServerless DBを考える~
soso_15315
1
160
今こそ始める、CDKコンストラクトライブラリ開発 ― 入門から実践まで
tmokmss
1
930
Android開発者のための Kotlin Multiplatform入門
ntaro
0
190
How to use Macrobenchmark
veronikapj
0
160
Clean Architecture by TypeScript & NestJS
ryounasso
0
150
HMSコンペ 11th Solution (team : kansai-kaggler)
t88
1
680
わかりやすい正解を捨てて、コトに向き合う - スクラムフェス金沢2024 スポンサーセッション
yusukekokubo
0
170
Advanced App Shrinking Techniques
cbeyls
2
150
SRE チーム立ち上げ前に考えたこと・取り組んだこと / Considerations and Preparations Before Establishing an SRE Team
mackey0225
3
320
Temporalを取り巻く仕様を整理する
sajikix
0
110
最古の関数型言語「Lisp」ことはじめ / lisp_in_kamiyama
uhooi
1
190
Architectures with Lightweight Stores: New Rules and Options
manfredsteyer
PRO
0
100
Featured
See All Featured
The Brand Is Dead. Long Live the Brand.
mthomps
52
36k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
Rails Girls Zürich Keynote
gr2m
93
13k
Scaling GitHub
holman
458
140k
The Illustrated Children's Guide to Kubernetes
chrisshort
39
47k
Faster Mobile Websites
deanohume
303
30k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
353
29k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.4k
Building Your Own Lightsaber
phodgson
101
5.9k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
19k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
GraphQLとの向き合い方2022年版
quramy
36
13k
Transcript
KSScreenshotManager Chuck Shnider twi er: @cshnider ∑
It starts small enough…
None
None
None
None
We’re Gonna Need a Bigger Slide…
None
Production Work
Heaven forbid you have to update them later!
KSScreenshotManager wri en by Kent Sutherland from Flexibits twi er:
@KSuther
@KSuther
h ps://github.com/ksuther/KSScreenshotManager Open-Source
KSScreenshotManager •Make your code generate the screenshots •Fully-Automated •Runnable from
scripting environments •Sample Python Script included •Uses “WaxSim” to drive the iOS Simulator
Like Test Automation •Not “For Free” •Cheaper to repeat over
time •Effort scales more slowly than manual screenshots
Modifying Your Code •WARNING Private API Usage! •Make sure none
of this ships to the AppStore •Conditional Compile and perhaps use a new target
Modifying Your Code •Add KSScreenshotManager and KSScreenshotAction.h / .m to
your project. #de ne CREATING_SCREENSHOTS
Modifying Your Code •Create a subclass of KSScreenshotManager •Override -(void)setupScreenshotActions;
setupScreenshotActions •Create instances of KSScreenshotAction •block-based API with optional cleanup
blocks •synch or async, status bar or no [self addScreenshotAction:newAction];
KSScreenshotAction block •Get the app to the correct state •Cheat
as necessary •Fake Data, Mock Objects, etc. •Private APIs, both app and OS
AppDelegate Changes #if CREATING_SCREENSHOTS dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 *
NSEC_PER_SEC)); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ MyScreenshotManager *screenshotManager = [[MyScreenshotManager alloc] init]; [screenshotManager setTableViewController:viewController]; [screenshotManager takeScreenshots]; }); #endif
Demo