Visualize touches, gestures and long presses on your iPhone or iPad
Go to file
2015-01-13 13:31:40 +08:00
Classes Reformat code 2015-01-13 13:31:40 +08:00
Example Fixed setting for ripple color 2014-03-25 07:26:25 -07:00
.gitignore Initial commit 2014-03-22 11:47:04 -07:00
CHANGELOG.md Updated animations to support iOS6 syntax 2014-04-13 08:31:50 -07:00
COSTouchVisualizer.podspec Updated podspec 2014-11-13 18:10:38 -08:00
LICENSE Initial commit 2014-03-22 11:47:04 -07:00
Rakefile Initial commit 2014-03-22 11:47:04 -07:00
README.md Update README.md 2014-11-30 18:15:47 +01:00
screenshot-drag.png Updated metadata 2014-03-23 21:21:39 -07:00
screenshot-press.png Updated metadata 2014-03-23 21:21:39 -07:00
touchvisdemo.gif Updated metadata 2014-03-23 21:21:39 -07:00

COSTouchVisualizer

COSTouchVisualizer

Version Platform

Swift Usage

Using COSTouchVisualizer is possible with Swift. Inside your AppDelegate, redefine your window and declare a visualizer window with storyboards.

With Storyboards

class AppDelegate: UIResponder {
  lazy var window: COSTouchVisualizerWindow? = {
    COSTouchVisualizerWindow(frame: UIScreen.mainScreen().bounds)
  }()
...
}

Without Storyboards

Objective-C Usage

To run the example project; clone the repo, and run pod update from the Example directory first. By default, this project has Debug Mode disabled. If you want to see the gestures while you're testing, follow the Debugging Mode instructions.

With Storyboards in your AppDelegate implementation simply add the following getter

#import <COSTouchVisualizerWindow.h>

...

// Add this method to your AppDelegate method
- (COSTouchVisualizerWindow *)window
{
    static COSTouchVisualizerWindow *visWindow = nil;
    if (!visWindow) visWindow = [[COSTouchVisualizerWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    return visWindow;
}

Without Storyboards

#import <COSTouchVisualizerWindow.h>

...

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Setup window
    self.window = [[COSTouchVisualizerWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window.backgroundColor = [UIColor whiteColor];

    ...

}

Debugging Mode

To enable debugging mode, edit the COSTouchVisualizerWindow.m file in the Pods Project under Pods/COSTouchVisualizerWindow/COSTouchVisualizerWindow.m

#ifdef TARGET_IPHONE_SIMULATOR
#define DEBUG_FINGERTIP_WINDOW 0
#else
#define DEBUG_FINGERTIP_WINDOW 0
#endif

Customization

// Add these lines after the windows is initialized
// Touch Color
[visWindow setFillColor:[UIColor yellowColor]];
[visWindow setStrokeColor:[UIColor purpleColor]];
[visWindow setTouchAlpha:0.4];
// Ripple Color
[visWindow setRippleFillColor:[UIColor yellowColor]];
[visWindow setRippleStrokeColor:[UIColor purpleColor]];
[visWindow setRippleAlpha:0.1];

Requirements

This project requires ARC.

Installation

COSTouchVisualizer is available through CocoaPods, to install it simply add the following line to your Podfile:

pod "COSTouchVisualizer"

Author

Joe Blau, josephblau@gmail.com

License

COSTouchVisualizer is available under the MIT license. See the LICENSE file for more info.