SwiftUI
The Jiggicons Swift package for iOS, macOS and visionOS.
In Xcode, choose File → Add Package Dependencies and enter:
https://github.com/adrianabelarde/jiggicons-swiftOr in Package.swift:
.package(url: "https://github.com/adrianabelarde/jiggicons-swift", from: "0.1.0")import SwiftUI
import Jiggicons
struct InboxView: View {
var body: some View {
JiggIcon("bell", variant: .solid, size: 28, sound: true, label: "Notifications")
.foregroundStyle(.primary)
}
}Tap the icon and it plays. It works on iOS 15, macOS 12, tvOS 15 and visionOS and later, and follows Reduce Motion.
Parameters
| Parameter | Default | |
|---|---|---|
variant | .outline | .outline, .solid, .duotone or .glass. Styles |
size | 24 | Width and height in points |
color | nil | The icon’s colour; without it, the view’s .foregroundStyle |
sound | false | Play the icon’s spatial sound with its motion |
volume | 1 | Sound volume from 0 to 1 |
trigger | .tap | .tap, .appear or .none |
playWhen | nil | Plays whenever this value changes |
label | nil | Accessible name. Leave it out when the icon sits next to a visible label. Accessibility |
Play from code
Change playWhen to play the icon when something else happens:
@State private var saved = 0
Button { saved += 1 } label: {
Label {
Text("Save")
} icon: {
JiggIcon("saved", variant: .duotone, trigger: .none, playWhen: saved)
}
}Sound
Each sound is made by the same synthesis as on the web, already placed between the two speakers along the path the icon moves, and ships in the package as a small .m4a file. Sounds play through AVAudioPlayer in the ambient category: they mix with music and stay quiet when the phone is set to silent. If your app has set its own audio session, it is left as it is.
JiggiconsAudio.shared.volume = 0.6Single frames
JiggiconFrame draws one pose of an icon, for previews or your own timing:
if let bell = Jiggicons.icon(named: "bell") {
JiggiconFrame(icon: bell, variant: .glass, seconds: 0.2)
}The Swift package has the 80 free icons.