Contents

xaxis47/plus-minus-slider

If you want to express plus and minus values with one slider, please use this PlusMinusSlider. This slider can provide you positive and negative values, several fonts, font weights and colors. It is written in SwiftUI.

Cocoapods

pod “PlusMinusSlider”

Usage

Import the framework.

import PlusMinusSlider

Make PlusMinusSlider and must fill “thumbValue”. Don't set over limit value. If the upper limit is exceeded, a fatalError will occur. iOS version is 16 or higher.

import SwiftUI
import PlusMinusSlider

struct ContentView: View {

//you can set several thumbValue
  @State var thumbValue: Double = 0

  var body: some View {

    PlusMinusSlider(thumbValue: $thumbValue)

  }

}

If you need you can change appearance with some modifier.

      .isHideLimitValue(_ bool:)
      .isHideThumbValue(_ bool:)
      .isIntValue(_ bool:)
      .limitValueOffset(_ offset:)
      .maxValueColor(_ color:)
      .maxValueFont(_ font:)
      .maxValueFontWeight(_ weight:)
      .minValueColor(_ color:)
      .minValueFont(_ font:)
      .minValueFontWeight(_ weight:)
      .sliderColor(_ color:)
      .thumbColor(_ color:)
      .thumbValueColor(_ color:)
      .thumbValueFont(_ font:)
      .thumbValueFontWeight(_ weight:)
      .valueColor(_ color:)
            
      new!!
      .barWidth(_ width:)
      .barHeight(_ height:)
      .isUnderValue(_ bool:) 
      .isVertical(_ bool:)
      .maxValue(_ value:)
      .minValue(_ value:)
      .thumbDiameter(_ diameter:)
      .thumbValueOffset(_ offset:)
      .maxSFSymbolsString(_ string:)
      .minSFSymbolsString(_ string:)


      

Untested

The library is basically untested. Please report bugs via the issue tracker on GitHub.

License

Licensed under the Apache License 2.0. See the LICENSE file for more information.

Thanks!

Package Metadata

Repository: xaxis47/plus-minus-slider

Default branch: main

README: README.md