This project demonstrates two custom sliders built with SwiftUI: TOAdvancedSlider and TOEasySlider. The sliders are designed for flexibility and style, making them suitable for various use cases in your apps.
- Fully customizable slider with:
- Gradient fills.
- Striped overlays.
- Dynamic styling options.
- Lightweight and easy-to-use slider for basic use cases.
- Minimalistic design with essential functionality.
RoundedTriangle.swift: Defines the rounded triangle shape used in the slider's handle.StripedOverlay.swift: Provides striped patterns for overlay effects.
- Integration with Swift Package Manager (SPM) for easier distribution and installation.
-
Add the following files to your project:
TOAdvancedSlider.swiftTOEasySlider.swiftRoundedTriangle.swiftStripedOverlay.swift
-
Use the sliders in your SwiftUI views:
import SwiftUI
struct ContentView: View {
@State var Value: CGFloat = 50
@State var currentValue: CGFloat = 40
@State var optimalValue: CGFloat = 75
let minValue: CGFloat = 0
let maxValue: CGFloat = 100
var body: some View {
VStack(spacing: 20) {
TOEasySlider(value: $Value)
.frame(height: 50)
TOAdvancedSlider(optimalValue: $optimalValue, currentValue: currentValue, minValue: minValue, maxValue: maxValue)
.frame(height: 50)
}
.padding()
}
}| TOEasySlider | TOAdvancedSlider |
|---|---|
![]() |
![]() |
- iOS 17.0+
- Swift 5.5+
Contributions are welcome! Feel free to open issues or submit pull requests.


