尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
Twelve sliders you'll want to touch, for SwiftUI. One view, one enum: Scrubber(.jelly, value: $value). Liquid Glass, jelly, elastic, fluid, squiggle, thermostat, swing, mood and more.
翻譯準備中
正在載入完整 README。
檢視完整 README ↗Twelve sliders you will want to touch, for SwiftUI: one view, one enum, one line to drop in.
Install
dependencies: [
.package(url: "https://github.com/haplollc/Scrubbers", from: "1.0.0")
]
Try it
import SwiftUI
import Scrubbers
struct VolumeRow: View {
@State private var volume = 0.6
var body: some View {
Scrubber(.elastic, value: $volume)
.scrubberIcons(low: "speaker.fill", high: "speaker.wave.3.fill")
}
}
If this is useful, a star helps others find it.
That is the whole integration. Swap .elastic for any of the twelve styles below. Each one is its own control with its own feel under the finger, not a skin on one slider: jelly that buckles when you push it, a pill that turns into a lens, a bead that pops out on a gooey neck, a thermostat you turn round its ring. They all take the same value, range and step, tick a light haptic at each detent, read to VoiceOver as a standard slider, and follow your .tint.
It started as the ruler under iOS Eras, pulled out into its own component. The other eleven recreate some of the best-loved sliders from Apple, Google, Nest, Instagram and the design community.
Watch the 35-second demo, with sound (MP4)
In Xcode: File > Add Package Dependencies and paste
https://github.com/haplollc/Scrubbers
Or in Package.swift:
dependencies: [
.package(url: "https://github.com/haplollc/Scrubbers", from: "1.0.0")
]
Then add Scrubbers to your target's dependencies.
import SwiftUI
import Scrubbers
struct VolumeRow: View {
@State private var volume = 0.6
var body: some View {
Scrubber(.elastic, value: $volume)
.scrubberIcons(low: "speaker.fill", high: "speaker.wave.3.fill")
}
}
Every style is a case of ScrubberStyle. Pass it as the first argument.
以上為 README 的開頭部分。其餘內容請閱讀原文。 檢視完整 README ↗