thehung111 / nhrangeslider Goto Github PK
View Code? Open in Web Editor NEWA custom range slider in Swift
Home Page: https://thehung111.github.io/NHRangeSlider/
License: MIT License
A custom range slider in Swift
Home Page: https://thehung111.github.io/NHRangeSlider/
License: MIT License
I updated existing X-Code 11.3 (was 10.1), its working fine when i was used X-Code 10.1.
swift version : 5.0
Now, Im getting error here,
NHSliderView/NHRangeSlider.framework/NHRangeSlider' for architecture x86_64
one more error:
Module compiled with Swift 4.2.1 cannot be imported by the Swift 5.1.3 compiler:
can you help me ..
Thanks
Is it possible to attack a image on thumb?
I need to get the slider delegate value whenever i changed the slider value ,,. Its coming for single slider only in the delegate method.!
Here i used three different slider.!
i Tried to used like the below code:
if slider?.tag == 0 {
self.first_upper_lb.text = "(Int((slider?.upperValue)!))"
self.first_lower_lb.text = "(Int((slider?.lowerValue)!))"
}else if slider?.tag == 1 {
self.dep_upper_lb.text = milli_date_format.milliseconds_to_date(milliseconds: Int((slider?.upperValue)!)).timeOnly24hrs
self.dep_lower_lb.text = milli_date_format.milliseconds_to_date(milliseconds: Int((slider?.lowerValue)!)).timeOnly24hrs
}else if slider?.tag == 2 {
self.arr_upper_lb.text = milli_date_format.milliseconds_to_date(milliseconds: Int((slider?.upperValue)!)).timeOnly24hrs
self.arr_lower_lb.text = milli_date_format.milliseconds_to_date(milliseconds: Int((slider?.lowerValue)!)).timeOnly24hrs
}
But here its tag was not working.! everytime its tag value was zero only how to differentiate the different slider value.!?
Please tell is there any solution for this.!
@IBInspectable open var stepValue: Double? = nil {
willSet(newValue) {
if newValue != nil {
assert(newValue! > 0, "NHRangeSlider: stepValue must be positive")
}
}
didSet {
if let val = stepValue {
if val <= 0 {
stepValue = nil
}
}
updateLayerFrames()
}
}
@IBInspectable open var stepValue: Double? = nil {
didSet {
self.rangeSlider?.stepValue = stepValue
}
}
AS i am tried to do was
func sliderValueChanged(slider: NHRangeSlider?) {
self.custom_firstrange_slide.upperLabel?.text = "hrs and mins: (slider?.upperValue)"
self.custom_firstrange_slide.lowerLabel?.text = "hrs and mins: (slider?.lowerValue)"
}
But its not working for me i tried so much of methods to call this.
So please tell if any suggestion for this.!
not support swift 4.0
I am facing issue in following function:
/// stepValue. If set, will snap to discrete step points along the slider . Default to nil
@IBInspectable open var stepValue: Double? = nil {
willSet(newValue) {
if newValue != nil {
assert(newValue! > 0, "NHRangeSlider: stepValue must be positive")
}
}
didSet {
if let val = stepValue {
if val <= 0 {
stepValue = nil
}
}
updateLayerFrames()
}
}
At this line @IBInspectable open var stepValue: Double? = nil , I face error like, Property cannot be marked @IBInspectable because its type cannot be represented in Objective-C
I would love to use your slider, but my project is in swift 2.2 :/ Any chances that it will work somehow? I tried with version 0.1, but it doesn't build
Hi,
Your pod doesn't compile with Swift 4. Could you please update it ?
Thank you
Easiest to reproduce when gapBetweenThumbs = 0. Steps to reproduce:
Can you add an example in your demo app?
When I tried to add a UIView in storyboard an change it to be NHRangeSliderView class, it doesn't work. I'm only able to add it programmatically.
Now the upperLabel is going beyond the view when it is a large number, for example 1000000000, so if it is possible to align the upperLabel right side with whole view?
How does one change the color of the lower and upper value? Mine are always black...
Hello. At first thanks for your slider, i create custom and very happy now)
Help me please. If i have some poing on a slider and i need dont let lover and upper value going over this point to right and left respectively.
I am try do it in valueChanged, but its not so cool, because it jerks.
override func rangeSliderValueChanged(_ rangeSlider: NHRangeSlider) {
super.rangeSliderValueChanged(rangeSlider)
if rangeSlider.lowerValue > Double(kidLeftIndex) {
rangeSlider.lowerValue = Double(kidLeftIndex)
return
}
if rangeSlider.upperValue < Double(kidLeftIndex + 1) {
rangeSlider.upperValue = Double(kidLeftIndex + 1)
return
}
}
can we remove the assertion of this condition?
@IBInspectable open var minimumValue: Double = 0.0 { willSet(newValue) { assert(newValue < maximumValue, "NHRangeSlider: minimumValue should be lower than maximumValue") } didSet { updateLayerFrames() } }
I use pod 'NHRangeSlider', '~> 0.2'
and Swift 3
and Xcode 8.3.3
Hi, been using the RangeSlider for my app, is it possible to remove the upper and lower labels on the thumbs?
What I've been using is just setting displayformat for both to be null strings, is there a better way?
Hi,
I'm using this lib, It's helpful. but I can't change value's slider when input value from textField.
can you help me?
thanks.
Please can you add the @objc attribute / objective c support ?
As i am creating the NHRangeslider inside of the tableview but hear i have an issue to increase the width of the lowerlabel and upper label text depends on the string whatever i give..?
i mean how to set the width of label dynamically, belongs to the text size.?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.