|ReleasedLast Release||Dec 2014|
Maintained by Unclaimed.
SKUTouchPresenter allows you to demo your app to an audience and have them follow your touches. It displays a dot (or multiple dots) wherever the screen is touched. You can configure the dot's color and opacity, and you can also have the dot(s) appear only when the device is mirroring to a second display via AirPlay or an adapter cable.
A sample app is included, which allows you to turn dots on & off and customize the color/opacity:
Manually (without Cocoapods):
SKUTouchPresenter.mfiles to your project.
QuartzCoresystem framework to your project.
Important: if you already use a custom subclass of
UIApplication, then you
SKUTouchPresenter.h and change the superclass from
the name of your custom subclass (so the inheritance chain is
showTouchesWhenMirroringWithColor: in your
application delegate, or whenever you want to start showing touches.
+ (void) showTouchesWithColor: (UIColor *)color
Enables (or disables) showing dots wherever the screen is touched. Pass
+ (void) showTouchesWhenMirroringWithColor: (UIColor *)color
Enables (or disables) showing dots wherever the screen is touched, but only when the device is mirroring to a second display.
+ (void) setTouchRadius: (CGFloat)radius
Sets the radius of the dot in pixels. The default is 20 pixels.
The SKUTouchPresenter class works with or without ARC.
When enabled, the class intercepts touch events via
displaying a dot wherever a touch occurs. Events are passed onward, so this
shouldn't affect your app's behavior.
In order to intercept events via
UIApplication sendEvents:, you typically
UIAppliation. By default, the code uses dynamic subclassing
to do this automatically the first time you call
showTouchesWhenMirroringWithColor. This enables you to wrap these
#define blocks and only include the functionality for particular builds.
SKUTouchPresenter does not use any private APIs and should be fine for App Store approval.
However, you can set it up manually without the dynamic subclassing: you just need to
add SKUTouchPresenter as a custom subclass of
UIApplication. Here's how to do that:
@"SKUTouchPresenter"as the third argument to
UIApplicationthen please see the notes about custom subclasses in the Usage section.
SKUTouchPresenter.mand delete the two blocks of code that say "Can delete if subclassing...".
Copyright 2011-2014 Scott Guelich. May be distributed in accordance with the MIT license.