{"id":25453557,"url":"https://github.com/xcessentials/viewevents","last_synced_at":"2025-11-02T07:30:27.862Z","repository":{"id":56927788,"uuid":"75197661","full_name":"XCEssentials/ViewEvents","owner":"XCEssentials","description":"[DEPRECATED - use 'SwiftUI' instead] Helpers for managing handlers of UIControl-based events and gesture recognizers.","archived":false,"fork":false,"pushed_at":"2018-03-16T14:57:32.000Z","size":46,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T12:23:00.221Z","etag":null,"topics":["chainable","gesture-recognizer","swift","uicontrol","uikit","unified","xcode"],"latest_commit_sha":null,"homepage":"https://xcessentials.github.io/ViewEvents/","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/XCEssentials.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}},"created_at":"2016-11-30T15:01:07.000Z","updated_at":"2021-02-21T15:30:27.000Z","dependencies_parsed_at":"2022-08-20T23:30:44.214Z","dependency_job_id":null,"html_url":"https://github.com/XCEssentials/ViewEvents","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XCEssentials%2FViewEvents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XCEssentials%2FViewEvents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XCEssentials%2FViewEvents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XCEssentials%2FViewEvents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XCEssentials","download_url":"https://codeload.github.com/XCEssentials/ViewEvents/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239384682,"owners_count":19629509,"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":["chainable","gesture-recognizer","swift","uicontrol","uikit","unified","xcode"],"created_at":"2025-02-17T23:56:01.642Z","updated_at":"2025-11-02T07:30:27.812Z","avatar_url":"https://github.com/XCEssentials.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub tag](https://img.shields.io/github/tag/XCEssentials/ViewEvents.svg)](https://github.com/XCEssentials/ViewEvents/releases)\n[![CocoaPods](https://img.shields.io/cocoapods/v/XCEViewEvents.svg)](https://cocoapods.org/?q=XCEViewEvents)\n[![CocoaPods](https://img.shields.io/cocoapods/p/XCEViewEvents.svg)](https://cocoapods.org/?q=XCEViewEvents)\n[![license](https://img.shields.io/github/license/XCEssentials/ViewEvents.svg)](https://opensource.org/licenses/MIT)\n\n# Introduction\n\nHelpers for managing handlers of UIControl-based events and gesture recognizers.\n\n\n\n# How to install\n\nThe recommended way is to install using [CocoaPods](https://cocoapods.org/?q=XCEViewEvents):\n\n```ruby\npod 'XCEViewEvents', '~\u003e 1.1'\n```\n\n\n\n# How it works\n\nThis library provides set of helper functions via extensions for `UIControl` and `UIView` classes. These functions are just syntax sugar on top of standard UIKit API.\n\n\n\n# How to use\n\nFor example, here is how to add handler to `UIButton` instance `button` for `onTouchUpInside` (\"tap\") event (assume we have an appropriate function called `buttonTapHandler` on `self`):\n\n```swift\nbutton.onTouchUpInside.add(\n  #selector(buttonTapHandler),\n  of: self\n)\n```\n\nAlternatively, if `self` conforms to `HandlersOwner` protocol, the aboe example can be written like this:\n\n```swift\nself.bind(\n  #selector(buttonTapHandler),\n  with: button.onTouchUpInside\n)\n```\n\n\n\n## Gesture recognizers\n\nSame approach is used to bind handlers with gesture recognizers.\n\nFor example, here is how to add handler to `UIImageView` instance `image` for \"tap\" gesture (assume we have an appropriate function called `tapGestureHandler` on `self`):\n\n```swift\nimage.onTapGesture.addRecognizer(#selector(tapGestureHandler), of: self){ gesture in\n  // configure gesture here\n}\n```\n\nAlternatively, if `self` conforms to `HandlersOwner` protocol, the aboe example can be written like this:\n\n```swift\nself.bind(#selector(tapGestureHandler), with: image.onTapGesture){ gesture in\n  // configure gesture here\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcessentials%2Fviewevents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxcessentials%2Fviewevents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcessentials%2Fviewevents/lists"}