{"id":13903114,"url":"https://github.com/LukasCZ/GSTouchesShowingWindow-Swift","last_synced_at":"2025-07-18T00:33:24.772Z","repository":{"id":48370885,"uuid":"101394882","full_name":"LukasCZ/GSTouchesShowingWindow-Swift","owner":"LukasCZ","description":"Surface all touches in your iOS app when creating videos!","archived":false,"fork":false,"pushed_at":"2020-12-07T22:12:06.000Z","size":3258,"stargazers_count":379,"open_issues_count":7,"forks_count":20,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-10T18:53:16.376Z","etag":null,"topics":["apppreview","uiwindow","video"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LukasCZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-25T10:48:25.000Z","updated_at":"2024-10-16T00:12:51.000Z","dependencies_parsed_at":"2022-08-21T03:20:26.900Z","dependency_job_id":null,"html_url":"https://github.com/LukasCZ/GSTouchesShowingWindow-Swift","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasCZ%2FGSTouchesShowingWindow-Swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasCZ%2FGSTouchesShowingWindow-Swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasCZ%2FGSTouchesShowingWindow-Swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasCZ%2FGSTouchesShowingWindow-Swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukasCZ","download_url":"https://codeload.github.com/LukasCZ/GSTouchesShowingWindow-Swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226320895,"owners_count":17606375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apppreview","uiwindow","video"],"created_at":"2024-08-06T22:01:37.747Z","updated_at":"2024-11-25T11:31:17.793Z","avatar_url":"https://github.com/LukasCZ.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# GSTouchesShowingWindow-Swift\n\nA simple tool that automatically **shows all touches** inside your app as they are happening, using a circular image indicator. It's useful for creating **App Previews** for the App Store or any kind of **app videos** where you need to demonstrate some rich user interaction that would be hard to showcase otherwise.\n\n(Looking for Objective-C version? It's [here](https://github.com/LukasCZ/GSTouchesShowingWindow).)\n\n## Example\n\n\u003cimg src=\"ReadmeFiles/TouchesPreviewTimelines.gif\" width=\"320px\"\u003e\n\nShort interaction in [Timelines](https://timelinesapp.io), my app for tracking time.\n\n## Installation\n\nGSTouchesShowingWindow is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:\n\n```ruby\npod 'GSTouchesShowingWindow-Swift'\n```\n\nAlternatively, you can just drag `GSTouchesShowingWindow-Swift/Classes` and `GSTouchesShowingWindow-Swift/Assets.xcassets` into your project.\n\n## How to set it up\n\nIn your `AppDelegate.swift`, replace `var window: UIWindow?` with the following code:\n\n```Swift\n    var customWindow: GSTouchesShowingWindow?\n    var window: UIWindow? {\n        get {\n            customWindow = customWindow ?? GSTouchesShowingWindow(frame: UIScreen.main.bounds)\n            return customWindow\n        }\n        set { }\n    }\n```\n\nIf you're using the CocoaPods integration, you also need to add the following import at the top of the file:\n```Swift\nimport GSTouchesShowingWindow_Swift\n```\n\nAnd that's it!\n\n### App Extensions\nIf you are using App Extensions (such as Today extension or Keyboard extension), you can also show touches in them.\nFirst, you need to integrate GSTouchesShowingWindow-Swift in your App Extension target. If you're using CocoaPods, you need to add the pod like this:\n\n```ruby\ntarget 'Today Extension' do\n    use_frameworks!\t\n    pod 'GSTouchesShowingWindow-Swift'\nend\n```\n\nIf you're not using CocoaPods, you need to either drag the `GSTouchesShowingWindow-Swift/Classes` into your extension's target, or you can set their **Target Membership** to include the extension as well:\n\n![Setting the Target membership in Utilities / File inspector / Target membership](ReadmeFiles/Target-membership-instructions.png)\n\n\nThen, in your `KeyboardViewController.m` or `TodayViewController.m`, add the following line near the end of `-viewDidLoad:` method:\n\n```Swift\nself.view.addGestureRecognizer(GSTouchesShowingGestureRecognizer())\n```\n\nSame as with main app target: if you're using the CocoaPods integration, you also need to import the module using:\n```Swift\nimport GSTouchesShowingWindow_Swift\n```\n\nNote: 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.\n\n## How it actually works\n\nInside the UIWindow subclass, I am overriding the `-sendEvent` method, processing all the events and directing them to a controller object that takes care of adding/moving/removing imageViews based on those events' touches. And then I call `[super sendEvent];` so that the touches are forwarded to the app itself. Refer to [Understanding Responders and the Responder Chain](https://developer.apple.com/library/content/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/HandlngEventsUsingtheResponderChain.html) to learn more. For extensions, a `UIGestureRecognizer` subclass is used because it's not possible to override window.\n\nIf you have any questions, you're welcome to get in touch with me on Twitter [@luksape](http://twitter.com/luksape). And if you use this when creating your app video, I'd love to hear from you!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLukasCZ%2FGSTouchesShowingWindow-Swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLukasCZ%2FGSTouchesShowingWindow-Swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLukasCZ%2FGSTouchesShowingWindow-Swift/lists"}