Latest 1.0.2
Homepage https://github.com/LukasCZ/GSTouchesShowingWindow
License MIT
Platforms ios 8.0
Authors

GSTouchesShowingWindow

A simple tool that automatically shows all touches inside your app as they are happening, using a circular image indicator. It’s useful for creating iOS 8 App Previews, or any kind of app videos where you need to demonstrate some rich user interaction that might be hard to explain otherwise.

Example

Short interaction in Timelines, my app for tracking time.

Installation

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

pod 'GSTouchesShowingWindow'

Alternatively, you can just drag the contents of GSTouchesShowingWindow/Classes and GSTouchesShowingWindow/Assets into your project.

How to set it up

A) Now, if you are using Storyboard in your project (and you should), do the following. If you are not using Storyboard, take a look at option B below.
In your AppDelegate.m, import the header:

#import “GSTouchesShowingWindow.h”

and add the following -window method. This will provide the app with our own window instance instead of the default UIWindow.

- (GSTouchesShowingWindow *)window {
    static GSTouchesShowingWindow *window = nil;
    if (!window) {
        window = [[GSTouchesShowingWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    }
    return window;
}

B) If you are still using plain old .xib files, you only need to open your MainWindow.xib, select the window and then change the class in Identity Inspector from UIWindow to GSTouchesShowingWindow. Like this:

A note about App Extensions

With latest update to GSTouchesShowingWindow, I added support for showing touches in Keyboard and Today extensions.

In your KeyboardViewController.m or TodayViewController.m, add the following line near the top:

#import "GSTouchesShowingGestureRecognizer.h"

and then in -viewDidLoad:, add:

[self.view addGestureRecognizer:[[GSTouchesShowingGestureRecognizer alloc] init]];

Note: In Today extensions (Widgets), the touch will disappear shortly after you start dragging (both horizontally and vertically). That’s to be expected, because system takes over control of the gesture.

How it actually works

Inside the UIWindow subclass, I am just overriding the -sendEvent method, processing all the events and adding/moving/removing imageViews based on those events’ touches. And then I call [super sendEvent]; so that the touches are forwarded to the app. Refer to Understanding Responders and the Responder Chain to learn more. For extensions, a UIGestureRecognizer subclass is used because it’s not possible to override window.

If you have any questions, feel free to contact me on Twitter @luksape.

Latest podspec

{
    "name": "GSTouchesShowingWindow",
    "version": "1.0.2",
    "summary": "UIWindow subclass that makes all touches in your app visible.",
    "description": "GSTouchesShowingWindow is a drop-in component (UIWindow subclass) that will visualize all touches in your app as they are happening. It's great for creating App Previews or any kind of app videos. (Update: Now it works for Keyboard and Today extensions as well. See Readme for instructions.)",
    "homepage": "https://github.com/LukasCZ/GSTouchesShowingWindow",
    "screenshots": [
        "https://raw.githubusercontent.com/LukasCZ/GSTouchesShowingWindow/master/Sample-touches-screenshot.png",
        "https://raw.githubusercontent.com/LukasCZ/GSTouchesShowingWindow/master/TouchesPreviewTimelines.gif"
    ],
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "authors": {
        "Lukas Petr": "[email protected]"
    },
    "source": {
        "git": "https://github.com/LukasCZ/GSTouchesShowingWindow.git",
        "tag": "1.0.2"
    },
    "social_media_url": "https://twitter.com/luksape",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "GSTouchesShowingWindow/Classes/**/*",
    "resource_bundles": {
        "GSTouchesShowingWindow": [
            "GSTouchesShowingWindow/Assets/*.png"
        ]
    },
    "resources": "GSTouchesShowingWindow/Assets/*.png"
}

Pin It on Pinterest

Share This