UPDATE:
It did not seem to me, because everything was white. Thus, a solution that does not use any other frameworks and adheres to this, you need to install all the views for all components, and then it will display well:

I tried to import it into Swift, as I used it in Objective-C code, but with no luck. If I configure everything correctly and add it to either viewDidLoad() or viewDidAppear() , nothing will be displayed. One thing is worth mentioning though - when I enter the View debug hierarchy , the slider is actually on the canvas:

But it just doesn't display with all the colors that I set before adding a view to it. For the record, this is the code I used:
override func viewDidAppear(animated: Bool) { var rangeSlider = NMRangeSlider(frame: CGRectMake(50, 50, 275, 34)) rangeSlider.lowerValue = 0.54 rangeSlider.upperValue = 0.94 let range = 10.0 let oneStep = 1.0 / range let minRange: Float = 0.05 rangeSlider.minimumRange = minRange let bgImage = UIView(frame: rangeSlider.frame) bgImage.backgroundColor = .greenColor() rangeSlider.trackImage = bgImage.pb_takeSnapshot() let trackView = UIView(frame: CGRectMake(0, 0, rangeSlider.frame.size.width, 29)) trackView.backgroundColor = .whiteColor() trackView.opaque = false trackView.alpha = 0.3 rangeSlider.trackImage = UIImage(named: "") let lowerThumb = UIView(frame: CGRectMake(0, 0, 8, 29)) lowerThumb.backgroundColor = .whiteColor() let lowerThumbHigh = UIView(frame: CGRectMake(0, 0, 8, 29)) lowerThumbHigh.backgroundColor = UIColor.blueColor() rangeSlider.lowerHandleImageNormal = lowerThumb.pb_takeSnapshot() rangeSlider.lowerHandleImageHighlighted = lowerThumbHigh.pb_takeSnapshot() rangeSlider.upperHandleImageNormal = lowerThumb.pb_takeSnapshot() rangeSlider.upperHandleImageHighlighted = lowerThumbHigh.pb_takeSnapshot() self.view.addSubview(rangeSlider) self.view.backgroundColor = .lightGrayColor() }
Using the method to capture a UIView as a UIImage mentioned in this question :
extension UIView { func pb_takeSnapshot() -> UIImage { UIGraphicsBeginImageContextWithOptions(bounds.size, false, UIScreen.mainScreen().scale) drawViewHierarchyInRect(self.bounds, afterScreenUpdates: true) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return image } }
Another solution:
You can also try sgwilly / RangeSlider , it is written in Swift and therefore you do not even need the Bridging header.