尚未检测到更新。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 ↗