TouchVisualizer is a lightweight pure Swift implementation for visualising touches on the screen.
TouchVisualizer works with Swift 5.2 from version 4.0.0.
Note: Embedded frameworks require a minimum deployment target of iOS 9.0.
Information: To use TouchVisualizer with a project targeting iOS 8.0 or lower, you must include the
TouchVisualizer.swift source file directly in your project.
CocoaPods is a centralised dependency manager that automates the process of adding libraries to your Cocoa application. You can install it with the following command:
$ gem update $ gem install cocoapods $ pods --version
To integrate TouchVisualizer into your Xcode project using CocoaPods, specify it in your
Podfile and run
platform :ios, '9.0' use_frameworks! pod "TouchVisualizer", '~> 4.0'
Carthage is a decentralised dependency manager that automates the process of adding frameworks to your Cocoa application.
You can install Carthage with Homebrew using the following command:
$ brew update $ brew install carthage
To integrate TouchVisualizer into your Xcode project using Carthage, specify it in your
github "morizotter/TouchVisualizer" "4.0.0"
To install TouchVisualizer without a dependency manager, please add all of the files in
/Pod to your Xcode Project.
To start using TouchVisualizer, write the following line wherever you want to start visualising:
Then invoke visualisation, by calling:
and stop the presentation like this:
Get touch locations by this:
It is really simple, isn't it?
TouchVisualizer also has the ability to customize your touch events. Here is an example of what can be customized:
var config = Configuration() config.color = UIColor.redColor() config.image = UIImage(named: "YOUR-IMAGE") config.showsTimer = true config.showsTouchRadius = true config.showsLog = true Visualizer.start(config)
|color||Color of touch point and text.||default color|
|image||Touch point image. If rendering mode is set to ||circle image|
|defaultSize||Default size of touch point.||60 x 60px|
|showsTimer||Shows touch duration.||false|
|showsTouchRadius||Shows touch radius by scaling touch point. It doesn't work on simulator.||false|
Please file issues or submit pull requests for anything you’d like to see! We're waiting! :)
TouchVisualizer is released under the MIT license. Go read the LICENSE file for more information.
There is a similar touch visualization library called COSTouchVisualizer, which is written in Objective-C. COSTouchVisualizer supports earlier versions of iOS and is more mature. If TouchVisualizer isn't enough for you, try that!