{"id":16322282,"url":"https://github.com/p-x9/touchtracker","last_synced_at":"2025-09-05T19:38:16.671Z","repository":{"id":152744289,"uuid":"626997584","full_name":"p-x9/TouchTracker","owner":"p-x9","description":"👆Show a mark at the touched point on the View of SwiftUI and UIKit.","archived":false,"fork":false,"pushed_at":"2023-10-29T14:51:50.000Z","size":125,"stargazers_count":37,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-11T22:50:29.010Z","etag":null,"topics":["swiftui","touch","uikit"],"latest_commit_sha":null,"homepage":"https://p-x9.github.io/TouchTracker/documentation/touchtracker/","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/p-x9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-12T15:18:54.000Z","updated_at":"2024-09-13T11:34:28.000Z","dependencies_parsed_at":"2023-07-10T21:01:46.099Z","dependency_job_id":"dc6835bd-7886-4b6d-a27e-e07fc1761923","html_url":"https://github.com/p-x9/TouchTracker","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-x9%2FTouchTracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-x9%2FTouchTracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-x9%2FTouchTracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-x9%2FTouchTracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p-x9","download_url":"https://codeload.github.com/p-x9/TouchTracker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244085009,"owners_count":20395523,"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":["swiftui","touch","uikit"],"created_at":"2024-10-10T22:50:28.801Z","updated_at":"2025-03-20T22:31:22.308Z","avatar_url":"https://github.com/p-x9.png","language":"Swift","readme":"# TouchTracker\n\nShow a mark at the touched point on the View of SwiftUI.\n\n## Demo\n\nhttps://user-images.githubusercontent.com/50244599/231504004-e1a1e815-3156-4f03-ba52-316afa061781.MP4\n\n## Document\nSet the following for a View of SwiftUI.\n```swift\nText(\"Hello\")\n    .touchTrack()\n```\nAlternatively, it can also be written as follows\n```swift\nTouchTrackingView {\n    Text(\"Hello\")\n}\n```\n\n### Customize\n```swift\nText(\"Hello\")\n    .touchTrack() // show touch point\n    .touchPointRadius(8) // radius of mark on touched point\n    .touchPointOffset(x: 0, y: -10) // offset of mark position\n    .touchPointColor(.orange) // color of mark on touched point\n    .touchPointBorder(true, color: .blue, width: 1) // applying a border to touched points\n    .touchPointShadow(true, color: .purple, radius: 3) // shadow on touched points\n    .touchPointDisplayMode(.recordingOnly) // display mode of touched points\n    .showLocationLabel(true) // show touch coordinate\n```\n![Example](https://user-images.githubusercontent.com/50244599/231509731-d3ea5df0-1981-4911-9a14-2b57bf575eb7.PNG)\n\nIt is also possible to display images as follow\n```swift\nText(\"Hello\")\n    .touchPointImage(Image(systemName: \"swift\").resizable())\n```\n![Example2](https://user-images.githubusercontent.com/50244599/231510854-c1669ba5-2071-446d-8cda-5131bce14511.PNG)\n\n### UIKit\nIf you want to adapt it to the entire app created with UIKit, write the following.\nUse a view named `TouchTrackingUIView`\n```swift\nimport TouchTracker\n\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n\n    var window: UIWindow?\n\n    let v = TouchTrackingUIView(isShowLocation: true)\n\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -\u003e Bool {\n        if let window {\n            window.addSubview(v)\n            v.translatesAutoresizingMaskIntoConstraints = false\n\n            NSLayoutConstraint.activate([\n                v.topAnchor.constraint(equalTo: window.topAnchor),\n                v.bottomAnchor.constraint(equalTo: window.bottomAnchor),\n                v.leftAnchor.constraint(equalTo: window.leftAnchor),\n                v.rightAnchor.constraint(equalTo: window.rightAnchor),\n            ])\n        }\n        return true\n    }\n```\n\n\n#### Propagate touch events to other windows\nThe following configuration allows you to share a touch event received in one window with other windows.\n\n```swift\nv.shouldPropagateEventAcrossWindows = true\n```\n\nIn the given configuration, even when windows overlap, typically only one window receives a touch event.\nMoreover, if a touch event starts in one window, such as Window A, it will only be responsive in Window A, even if it moves to another window, like Window B.\n\nTherefore, the touch event can be shared so that the marker of the tapped point will be displayed in the other window even in such a case.\n\n\n## License\nTouchTracker is released under the MIT License. See [LICENSE](./LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp-x9%2Ftouchtracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp-x9%2Ftouchtracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp-x9%2Ftouchtracker/lists"}