{"id":28363178,"url":"https://github.com/adamfootdev/hapticskit","last_synced_at":"2025-07-10T09:37:58.470Z","repository":{"id":294456812,"uuid":"687983424","full_name":"adamfootdev/HapticsKit","owner":"adamfootdev","description":"Add haptic feedback to your app in just a few lines of code.","archived":false,"fork":false,"pushed_at":"2025-05-20T13:33:29.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T15:43:17.356Z","etag":null,"topics":["ios","swift","xcode"],"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/adamfootdev.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,"zenodo":null}},"created_at":"2023-09-06T12:12:43.000Z","updated_at":"2025-05-20T14:07:18.000Z","dependencies_parsed_at":"2025-05-20T14:50:28.765Z","dependency_job_id":null,"html_url":"https://github.com/adamfootdev/HapticsKit","commit_stats":null,"previous_names":["adamfootdev/hapticskit"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/adamfootdev/HapticsKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamfootdev%2FHapticsKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamfootdev%2FHapticsKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamfootdev%2FHapticsKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamfootdev%2FHapticsKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamfootdev","download_url":"https://codeload.github.com/adamfootdev/HapticsKit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamfootdev%2FHapticsKit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264559637,"owners_count":23628040,"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":["ios","swift","xcode"],"created_at":"2025-05-28T17:13:40.004Z","updated_at":"2025-07-10T09:37:58.464Z","avatar_url":"https://github.com/adamfootdev.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HapticsKit\n\n![Platform](https://img.shields.io/badge/platforms-iOS%2FiPadOS%2017.0%2B%20%7C%20macOS%2014.0%2B%20%7C%20tvOS%2017.0%2B%20%7C%20visionOS%201.0%2B%20%7C%20watchOS%2010.0%2B-blue)\n\nHapticsKit provides developers for Apple platforms with the ability to quickly add haptic feedback to their apps.\n\nHapticsKit is available on all Apple platforms but is only functional on devices which have support for haptic feedback (iPhone \u0026 Apple Watch).\n\n1. [Requirements](#requirements)\n2. [Integration](#integration)\n3. [Usage](#usage)\n    - [HapticsKitConfiguration](#hapticskitconfiguration)\n    - [HapticsKit](#hapticskit)\n4. [Testing Haptic Feedback](#testing-haptic-feedback)\n5. [Other Packages](#other-packages)\n    - [AboutKit](https://github.com/adamfootdev/AboutKit)\n    - [FeaturesKit](https://github.com/adamfootdev/FeaturesKit)\n    - [HelpKit](https://github.com/adamfootdev/HelpKit)\n\n## Requirements\n\n- iOS/iPadOS 17.0+\n- macOS 14.0+\n- tvOS 17.0+\n- visionOS 1.0+\n- watchOS 10.0+\n- Xcode 15.0+\n\n## Integration\n\n### Swift Package Manager\n\nHapticsKit can be added to your app via Swift Package Manager in Xcode. Add to your project like so:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/adamfootdev/HapticsKit.git\", from: \"2.0.9\")\n]\n```\n\n## Usage\n\nTo start using the framework, you'll need to import it first:\n\n```swift\nimport HapticsKit\n```\n\n### HapticsKitConfiguration\n\nThis is a struct containing all of the relevant details required to configure HapticsKit. It can be created like so:\n\n```swift\nlet configuration = HapticsKitConfiguration(\n    userDefaults: UserDefaults.standard, \n    storageKey: \"hapticFeedback\"\n)\n```\n\nBoth attributes are optional and default values can be used instead.\n\n### HapticsKit\n\nWhen launching your app, configure HapticsKit like so:\n\n```swift\nlet haptics = HapticsKit.configure(with: configuration)\n```\n\nIf you do not configure HapticsKit at launch, a default configuration will be used instead. You can then access HapticsKit in the future by referencing the created version as above or:\n\n```swift\nHapticsKit.shared\n```\n\nOn iOS, the following methods can be called to perform haptic feedback:\n\n```swift\nHapticsKit.shared.performNotification(.success) // .success, .warning, .error\n\nHapticsKit.shared.performImpact(.medium, at: 1.0) // .light, .medium, .heavy, .soft, .rigid; 0...1\n\nHapticsKit.shared.performSelection()\n```\n\nOn watchOS, the following method can be called to perform haptic feedback:\n\n```swift\nHapticsKit.shared.perform(.click) // .notification, .directionUp, .directionDown, .success, .failure, .retry, .start, .stop, .click\n```\n\nWhen performing haptic feedback, HapticsKit will check whether the user has haptic feedback enabled. The UserDefaults store and key can be configured as part of the configuration. Checking if haptic feedback is enabled can be done like so:\n\n```swift\nlet enabled = HapticsKit.shared.hapticFeedbackEnabled\n```\n\nThis value can be added to a SwiftUI Toggle as a binding. To check whether a device supports haptic feedback, you can use the following:\n\n```swift\nlet deviceSupportsHapticFeedback = HapticsKit.hapticFeedbackSupported\n```\n\n## Testing Haptic Feedback\n\nYou can use my app [Haptics](https://apps.apple.com/app/id1474606532) to test out the different haptic feedback combinations.\n\n## Other Packages\n\n### [AboutKit](https://github.com/adamfootdev/AboutKit)\n\nAdd an about screen to your app.\n\n### [FeaturesKit](https://github.com/adamfootdev/FeaturesKit)\n\nAdd a features list screen to your app.\n\n### [HelpKit](https://github.com/adamfootdev/HelpKit)\n\nAdd a help screen to your app.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamfootdev%2Fhapticskit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamfootdev%2Fhapticskit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamfootdev%2Fhapticskit/lists"}