Slide 1

Slide 1 text

KSScreenshotManager Chuck Shnider twi er: @cshnider ∑

Slide 2

Slide 2 text

It starts small enough…

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

We’re Gonna Need a Bigger Slide…

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

Production Work

Slide 10

Slide 10 text

Heaven forbid you have to update them later!

Slide 11

Slide 11 text

KSScreenshotManager wri en by Kent Sutherland from Flexibits twi er: @KSuther

Slide 12

Slide 12 text

@KSuther

Slide 13

Slide 13 text

h ps://github.com/ksuther/KSScreenshotManager Open-Source

Slide 14

Slide 14 text

KSScreenshotManager •Make your code generate the screenshots •Fully-Automated •Runnable from scripting environments •Sample Python Script included •Uses “WaxSim” to drive the iOS Simulator

Slide 15

Slide 15 text

Like Test Automation •Not “For Free” •Cheaper to repeat over time •Effort scales more slowly than manual screenshots

Slide 16

Slide 16 text

Modifying Your Code •WARNING Private API Usage! •Make sure none of this ships to the AppStore •Conditional Compile and perhaps use a new target

Slide 17

Slide 17 text

Modifying Your Code •Add KSScreenshotManager and KSScreenshotAction.h / .m to your project. #de ne CREATING_SCREENSHOTS

Slide 18

Slide 18 text

Modifying Your Code •Create a subclass of KSScreenshotManager •Override -(void)setupScreenshotActions;

Slide 19

Slide 19 text

setupScreenshotActions •Create instances of KSScreenshotAction •block-based API with optional cleanup blocks •synch or async, status bar or no [self addScreenshotAction:newAction];

Slide 20

Slide 20 text

KSScreenshotAction block •Get the app to the correct state •Cheat as necessary •Fake Data, Mock Objects, etc. •Private APIs, both app and OS

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

Demo