Coder Social home page Coder Social logo

rangesliderswiftui's Introduction

RangeSliderSwiftUI

Custom range slider in SwiftUI

License: MIT iOS Swift 5+ RangeSlider SwiftUI SPM

Custom range slider in SwiftUI

Installation

SPM (Swift Package Manager)

In Xcode, use the menu File > Swift Packages > Add Package Dependency... and enter the package URL https://github.com/Rahul-Mayani/RRRangeSliderSwiftUI.

Manually

  1. Download the project.
  2. Add RRRangeSliderSwiftUI.swift file for slider view
  3. Add necessary files in your project.
  4. Congratulations!

Usage example

To run the example project, clone the repo, and run pod install from the Example directory first.

alt text

@State var minValue: Float = 0.0
@State var maxValue: Float = Float(UIScreen.main.bounds.width - 50.0)

var body: some View {
    
    VStack {
        
        Text("Range Slider")
        /// slider view
        RRRangeSlider(
            minValue: self.$minValue, // mimimum value
            maxValue: self.$maxValue, // maximum value
            sliderWidth: CGFloat(maxValue), // set slider width
            backgroundTrackColor: Color(UIColor.systemTeal).opacity(0.5), // track color
            selectedTrackColor: Color.blue.opacity(25), // track color
            globeColor: Color.orange, // globe background color
            globeBackgroundColor: Color.black, // globe rounded border color
            globeMinMaxValuesColor: Color.black // all text label color
        )
    }
}


Contribute

We would love you for the contribution to RangeSliderSwiftUI, check the LICENSE file for more info.

License

RangeSliderSwiftUI is available under the MIT license. See the LICENSE file for more info.

rangesliderswiftui's People

Contributors

jigneshmayani90 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.