Skip to content

Commit

Permalink
Add progress color. (credit: jamchen)
Browse files Browse the repository at this point in the history
  • Loading branch information
raxcat committed May 11, 2016
1 parent 59a95e9 commit 9f64f00
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Pod/Classes/BufferSlider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public enum VerticalPosition:Int{
///fillColor property. @IBInspectable
@IBInspectable public var baseColor:UIColor = UIColor.lightGrayColor()

///fillColor property. @IBInspectable
@IBInspectable public var progressColor:UIColor? = UIColor.blueColor()

///fillColor property. @IBInspectable
@IBInspectable public var bufferColor:UIColor? = nil

Expand Down Expand Up @@ -170,6 +173,16 @@ public enum VerticalPosition:Int{
else{ UIColor(red: 0.0, green: 122.0/255.0, blue: 1.0, alpha: 1.0).setFill() }

UIBezierPath(rect: fillRect).fill()

if let color = progressColor {
color.setFill()
let fillRect = CGRectMake(
sliderRect.origin.x,
sliderRect.origin.y + borderWidth.CGFloatValue/2,
sliderRect.size.width*CGFloat((value-minimumValue)/(maximumValue-minimumValue)),
fillHeight)
UIBezierPath(rect: fillRect).fill()
}
}

}
Expand Down

0 comments on commit 9f64f00

Please sign in to comment.