software-mansion-labs/pulsar-ios
A haptic feedback SDK for iOS, written in Swift. Pulsar provides ready-to-use haptic presets, a pattern composer for custom haptic sequences, and a real-time composer for gesture-driven feedback.
Features
- Presets - Library of built-in haptic patterns (hammer, dogBark, buzz, pulse) and system feedback styles (impacts, notifications, selection)
- Pattern Composer - Define custom haptic patterns using discrete events and continuous amplitude/frequency envelopes
- Realtime Composer - Live amplitude and frequency control for gesture-driven haptics
- Apple-native - Built with Core Haptics and UIKit feedback generators
- Swift-first - Clean Swift API for iOS apps and SDK integrations
Quick start
Installation
Latest available version: 1.0.0
In Xcode, go to File > Add Package Dependencies... and use:
https://github.com/software-mansion-labs/pulsar-iosOr add Pulsar to your Package.swift:
dependencies: [
.package(url: "https://github.com/software-mansion-labs/pulsar-ios", from: "1.0.0")
]Then add "Pulsar" to your target dependencies.
Preset example
import Pulsar
let pulsar = Pulsar()
let presets = pulsar.getPresets()
// Play a preset
presets.hammer()
// Play a system haptic
presets.systemImpactMedium()PatternComposer example
import Pulsar
let pulsar = Pulsar()
let composer = pulsar.getPatternComposer()
let pattern = PatternData(
continuousPattern: ContinuousPattern(
amplitude: [
ValuePoint(time: 0, value: 0),
ValuePoint(time: 200, value: 1),
ValuePoint(time: 400, value: 0),
],
frequency: [
ValuePoint(time: 0, value: 0.3),
ValuePoint(time: 400, value: 0.8),
]
),
discretePattern: [
DiscretePoint(time: 0, amplitude: 1, frequency: 0.5),
DiscretePoint(time: 100, amplitude: 0.5, frequency: 0.5),
]
)
composer.playPattern(hapticsData: pattern)RealtimeComposer example
import Pulsar
let pulsar = Pulsar()
let realtime = pulsar.getRealtimeComposer()
realtime.set(amplitude: 0.7, frequency: 0.5)
realtime.stop()Documentation
Full API reference and guides are available at the documentation site.
- SDK Overview - Core concepts: types of haptics, preloading, and caching
- iOS SDK - Swift API reference
AI Skills
Install the pulsar-haptics skill from the software-mansion-labs/skills repository:
/plugin marketplace add software-mansion-labs/skills
/plugin install skills@swmansion
/reload-pluginsOr with npx:
npx skills add software-mansion-labs/skillsLicense
Pulsar library is licensed under The MIT License.
Try the Pulsar App
Download the Pulsar companion app to feel haptic presets directly on your device:
Community Discord
Join the Software Mansion Community Discord to chat about haptics or other Software Mansion libraries.
Pulsar is created by Software Mansion
Since 2012 Software Mansion is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues. We can help you build your next dream product – Hire us.
Package Metadata
Repository: software-mansion-labs/pulsar-ios
Default branch: main
README: README.md