{"id":2200,"url":"https://github.com/efremidze/Haptica","last_synced_at":"2025-08-06T13:32:34.136Z","repository":{"id":56914427,"uuid":"86864007","full_name":"efremidze/Haptica","owner":"efremidze","description":"Easy Haptic Feedback Generator 📳","archived":false,"fork":false,"pushed_at":"2022-08-28T01:25:50.000Z","size":720,"stargazers_count":774,"open_issues_count":5,"forks_count":42,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-29T03:18:35.795Z","etag":null,"topics":["apple","carthage","cocoapods","feedback","generator","haptic","ios","ios10","notes","patterns","swift","taptic","uibutton","vibrate"],"latest_commit_sha":null,"homepage":"","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/efremidze.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-31T22:09:07.000Z","updated_at":"2024-11-27T00:17:37.000Z","dependencies_parsed_at":"2022-08-21T02:50:57.986Z","dependency_job_id":null,"html_url":"https://github.com/efremidze/Haptica","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efremidze%2FHaptica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efremidze%2FHaptica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efremidze%2FHaptica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efremidze%2FHaptica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/efremidze","download_url":"https://codeload.github.com/efremidze/Haptica/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228831022,"owners_count":17978398,"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":["apple","carthage","cocoapods","feedback","generator","haptic","ios","ios10","notes","patterns","swift","taptic","uibutton","vibrate"],"created_at":"2024-01-05T20:16:07.412Z","updated_at":"2025-08-06T13:32:34.120Z","avatar_url":"https://github.com/efremidze.png","language":"Swift","funding_links":[],"categories":["Libs","UI","Hardware [🔝](#readme)"],"sub_categories":["Hardware","Other free courses","Font","Other Testing"],"readme":"![Haptica](https://raw.githubusercontent.com/efremidze/Haptica/master/Images/logo.png)\n\n[![CI](https://github.com/efremidze/Haptica/actions/workflows/ci.yml/badge.svg)](https://github.com/efremidze/Haptica/actions/workflows/ci.yml)\n[![CocoaPods](https://img.shields.io/cocoapods/v/Haptica.svg)](https://cocoapods.org/pods/Haptica)\n[![Carthage](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage)\n[![SPM](https://img.shields.io/badge/SPM-compatible-brightgreen.svg)](https://swift.org/package-manager/)\n[![Swift](https://img.shields.io/badge/Swift-5.9+-orange.svg)](https://swift.org)\n[![License](https://img.shields.io/github/license/efremidze/Haptica.svg)](https://github.com/efremidze/Haptica/blob/master/LICENSE)\n\n# Haptica\n\n**Haptica** is a simple and expressive haptic feedback generator for iOS.\n\n```bash\n$ pod try Haptica\n```\n\n---\n\n## 📱 Requirements\n\n| Haptica Version | iOS | Swift | Xcode |\n|-----------------|-----|-------|--------|\n| 4.x             | 13+ | 5.x   | 11+     |\n| 3.x             | 9+  | 5.x   | 8+      |\n| 2.x             | 9+  | 4.x   | 8+      |\n| 1.x             | 9+  | 3.x   | 8+      |\n\n### Haptic Feedback Requirements\n\n- Device with a supported Taptic Engine  \n- App running in the foreground  \n- System Haptics setting enabled  \n\n---\n\n## 🚀 Usage\n\nTrigger a haptic feedback with a single line:\n\n```swift\nHaptic.impact(.light).generate()\n```\n\n### Feedback Types\n\n- **Impact** (`.light`, `.medium`, `.heavy`, `.soft`, `.rigid`)  \n  Use to indicate collision or snap-to-position.\n- **Notification** (`.success`, `.warning`, `.error`)  \n  Use to communicate task results.\n- **Selection**  \n  Use for navigation through discrete values.\n\n### Semantic Types (New)\n\nUse new expressive variants for common interactions:\n\n```swift\nHaptic.success.generate()\nHaptic.warning.generate()\nHaptic.start.generate()\nHaptic.stop.generate()\nHaptic.increase.generate()\nHaptic.decrease.generate()\n```\n\nThese semantic styles internally map to appropriate UIKit or Core Haptics-based effects.\n\n### Custom Vibration Patterns\n\n```swift\nHaptic.play(\"..oO-Oo..\", delay: 0.1)\n```\n\n| Symbol | Feedback Type   |\n|--------|-----------------|\n| `.`    | Light impact    |\n| `o`    | Medium impact   |\n| `O`    | Heavy impact    |\n| `x`    | Soft impact     |\n| `X`    | Rigid impact    |\n| `-`    | 0.1s pause      |\n\nOr use structured notes:\n\n```swift\nHaptic.play([\n    .haptic(.impact(.light)),\n    .haptic(.impact(.heavy)),\n    .wait(0.1),\n    .haptic(.impact(.heavy)),\n    .haptic(.impact(.light))\n])\n```\n\n### 🔧 Core Haptics Support\n\nHaptica uses **Core Haptics** by default when available. To use the legacy API:\n\n```swift\nHaptic.play(notes, legacy: true)\n```\n\n### 📂 Play from Pattern File (New) - iOS 16+\n\nPlay a Core Haptics pattern from a bundled `.ahap` file:\n\n```swift\nHaptic.playPattern(named: \"Feedback\")\n```\n\nMake sure the file is included in your app bundle and contains a valid haptic pattern.\n\n---\n\n## 🧹 UIButton Extension\n\nEnable haptics for buttons easily:\n\n```swift\nbutton.isHaptic = true\nbutton.hapticType = .impact(.light)\n```\n\nAdd or remove haptic feedback on control events:\n\n```swift\nbutton.addHaptic(.selection, forControlEvents: .touchDown)\nbutton.removeHaptic(forControlEvents: .touchDown)\n```\n\n**API Summary:**\n\n```swift\nvar isHaptic: Bool\nvar hapticType: Haptic?\nvar hapticControlEvents: UIControl.Event?\n\nfunc addHaptic(_ haptic: Haptic, forControlEvents events: UIControl.Event)\nfunc removeHaptic(forControlEvents events: UIControl.Event)\n```\n\n---\n\n## 🔊 Sound Effects\n\nIntegrate sound feedback with [Peep](https://github.com/efremidze/Peep):\n\n```swift\nPeep.play(sound: KeyPress.tap)\n```\n\n---\n\n## 📦 Installation\n\n### Swift Package Manager\n\n```swift\n// For iOS 13+\n.package(url: \"https://github.com/efremidze/Haptica.git\", from: \"4.0.0\")\n\n// For iOS 9\n.package(url: \"https://github.com/efremidze/Haptica.git\", from: \"3.0.0\")\n```\n\n### CocoaPods\n\n```ruby\nuse_frameworks!\npod \"Haptica\"\n```\n\n### Carthage\n\n```ruby\ngithub \"efremidze/Haptica\"\n```\n\n---\n\n## 💬 Communication\n\n- Found a bug? → [Open an issue](https://github.com/efremidze/Haptica/issues)\n- Have a feature request? → [Open an issue](https://github.com/efremidze/Haptica/issues)\n- Want to contribute? → Submit a pull request\n\n---\n\n## 📰 Mentions\n\n- [Fresh Swift](http://freshswift.net/post/-kj8ocn5j9lt_ljpffm4/)\n\n---\n\n## 📄 License\n\nHaptica is available under the MIT license. See the [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefremidze%2FHaptica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefremidze%2FHaptica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefremidze%2FHaptica/lists"}