{"id":18271338,"url":"https://github.com/jakemarsh/JMWhenTapped","last_synced_at":"2025-04-05T01:31:26.290Z","repository":{"id":141999026,"uuid":"1489918","full_name":"jakemarsh/JMWhenTapped","owner":"jakemarsh","description":"Easily assign touch down, touch up, and tapped actions to UIViews using blocks.","archived":false,"fork":false,"pushed_at":"2015-10-27T07:57:32.000Z","size":955,"stargazers_count":201,"open_issues_count":2,"forks_count":24,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-31T06:17:27.619Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://deallocatedobjects.com/2011/04/27/save-time-and-code-with-jmwhentapped/","language":"Objective-C","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/jakemarsh.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-03-17T01:49:01.000Z","updated_at":"2025-03-09T09:44:09.000Z","dependencies_parsed_at":"2023-03-13T14:42:52.176Z","dependency_job_id":null,"html_url":"https://github.com/jakemarsh/JMWhenTapped","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakemarsh%2FJMWhenTapped","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakemarsh%2FJMWhenTapped/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakemarsh%2FJMWhenTapped/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakemarsh%2FJMWhenTapped/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakemarsh","download_url":"https://codeload.github.com/jakemarsh/JMWhenTapped/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276043,"owners_count":20912286,"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":[],"created_at":"2024-11-05T11:39:14.514Z","updated_at":"2025-04-05T01:31:21.282Z","avatar_url":"https://github.com/jakemarsh.png","language":"Objective-C","readme":"## What is it?\n\n`JMWhenTapped` is a simple little syntactical-sugar addition to all `UIView` objects, as well as any class that inherits from `UIView`. It allows you to assign touch-up, touch-down, tapped (touched down then up), double taps and two finger taps actions to a `UIView` object using a convenient blocks-style syntax. (Examples shown below).\n\n## Installation\n\nClone the repo. Add the `JMWhenTapped` folder to your iOS 4 project. `#import \"JMWhenTapped.h\"` wherever you'd like to use the syntax.\n\n## Examples \u0026 Usage\n\nUse it like this:\n\t\n\t[myView whenTapped:^{\n\t\tNSLog(@\"I was tapped!\");\n\t}];\n\t\nOr like this:\n\n\t[myView whenTouchedDown:^{\n\t\tNSLog(@\"I was touched down!\");\n\t}];\n\t\nAnd also like this:\n\n\t[myView whenTouchedUp:^{\n\t\tNSLog(@\"I was touched up!\");\t\t\n\t}];\n\nThis works the same way with double tap and two finger taps.\n\n## The Different Actions\n\nThe `whenTapped:` method should be used in cases where you simply want something to happen when the user taps on a view (i.e. you are concerned with performing some action when their finger is down then up, like changing to a \"pressed\" state.)\n\nThe `whenDoubleTapped:` method should be used when you want to check for double taps on your view.\n\nThe `whenTwoFingerTapped:` method should be used when you want to check for single taps made with two fingers (like in Maps.app).\n\nThe `whenTouchedDown:` method should be used when you want to trigger some action when the user touches down on your view.\n\nThe `whenTouchedUp:` method should be used when you want to trigger some action when the user touches up on your view.\n\n## Demo\n\nIncluded in this repo is a demo Xcode project that illustrates a quick example of how to use `JMWhenTapped`.","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakemarsh%2FJMWhenTapped","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakemarsh%2FJMWhenTapped","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakemarsh%2FJMWhenTapped/lists"}