SliderTickContentForEach
A type of slider content that creates content by iterating over a collection.
Platform Compatibility
iOS 26.0+ iPadOS 26.0+ macOS 26.0+ watchOS 26.0+ visionOS 26.0+
Tags
SwiftUI Code
Slider(value: $percentage) {
Text("Percentage")
} currentValueLabel: {
Text("\(percentage)%")
} ticks: {
SliderTickContentForEach(
stride(from: 0.0, through: 1.0, by: 0.25).map { $0 },
id: \.self
) { value in
SliderTick(value) {
Text("value: \(value * 100)%")
}
}
}
.padding(.horizontal)Found an issue or have a suggestion?
Created: December 25, 2025Updated: December 25, 2025