Touch Visualization During Presentations

Table of Content

I’ve used the awesome TouchVisulizer in several of my projects now, but the last couple times I’ve used it I had to use a fork since the original maintainer isn’t providing any updates for the latest iOS and Swift changes.

The other downside is that it is still only compatible with Carthage and CocoaPods. So, compared to SPM, it’s a lot more involved to integrate it into your project.

One might wonder what the value of this framework even is since users don’t usually want to see evidence of their grubby mitts on screen. The reason for it is for situations like presentations or screen recording demos. It’s notoriously hard to follow onscreen action when you have no context as to where the user touched.

Anyways, I had been day dreaming about how one would make one of these frameworks. Ultimately, I had the idea that I could track all touch events in a UIWindow, generate a circle CGPath for each touch, then render them in a CAShapeLayer drawn at the highest position on screen. So I did that.

Introducing TouchDoll

The result is my new framework TouchDoll, named for its ability to show you where on screen it’s being touched. It’s only available via SPM and is super simple to use.

  1. Import the module:
    • import TouchDoll
  2. Activate it
    • window.showTouches()
  3. If you ever want to toggle off
    • window.hideTouches()

Currently there are no configuration options. However, the code is quite simple and I would expect that many novice coders would be able to follow the logic. I am completely happy and open to pull requests, if any configuration options are deemed necessary.

Check it out! I hope you like it.

Leave a Reply

Your email address will not be published. Required fields are marked *