swiftui sliders
2.1.0
Este paquete le permite crear controles deslizantes y pistas altamente personalizables para el catalizador de iOS, MacOS y Mac.

Agregue este paquete Swift a su proyecto
[email protected]:spacenation/swiftui-sliders.git
Importar y usar
import Sliders
import SwiftUI
struct ContentView : View {
@ State var value = 0.5
@ State var range = 0.2 ... 0.8
@ State var x = 0.5
@ State var y = 0.5
var body : some View {
Group {
ValueSlider ( value : $value )
RangeSlider ( range : $range )
PointSlider ( x : $x , y : $y )
}
}
}Consulte la vista previa de cada archivo para ver un ejemplo
Use cualquier modificador de vista Swiftui para crear pistas y pulgares personalizados.
RangeSlider ( range : $model . range2 , distance : 0.1 ... 1.0 )
. rangeSliderStyle (
HorizontalRangeSliderStyle (
track :
HorizontalRangeTrack (
view : Capsule ( ) . foregroundColor ( . purple )
)
. background ( Capsule ( ) . foregroundColor ( Color . purple . opacity ( 0.25 ) ) )
. frame ( height : 8 ) ,
lowerThumb : Circle ( ) . foregroundColor ( . purple ) ,
upperThumb : Circle ( ) . foregroundColor ( . purple ) ,
lowerThumbSize : CGSize ( width : 32 , height : 32 ) ,
upperThumbSize : CGSize ( width : 32 , height : 32 ) ,
options : . forceAdjacentValue
)
) Siéntase libre de contribuir a través de la solicitud de Fork/Pull a Master Branch. Si desea solicitar una función o informar un error, inicie un nuevo problema.
Si encuentra útil este proyecto, considere convertirse en nuestro patrocinador de GitHub.