Skip to content

Commit

Permalink
Make things public so it can be used as a pod, sorry, bumps version t…
Browse files Browse the repository at this point in the history
…o 1.0.1
  • Loading branch information
owenworley committed May 4, 2016
1 parent 457137c commit 6ee4ab7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ScrubberBar.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Pod::Spec.new do |s|
s.summary = "An IBDesignable media scrubber bar similar to apple music, in swift"
s.requires_arc = true

s.version = "1.0.0"
s.version = "1.0.1"

s.license = { :type => "MIT", :file => "LICENSE" }

Expand Down
Binary file not shown.
28 changes: 14 additions & 14 deletions ScrubberBar/ScrubberBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import UIKit

protocol ScrubberBarDelegate: class {
public protocol ScrubberBarDelegate: class {
func scrubberBar(bar: ScrubberBar, didScrubToProgress: Float)
}

Expand All @@ -33,48 +33,48 @@ private extension Comparable {
}

@IBDesignable
class ScrubberBar: UIControl {
public class ScrubberBar: UIControl {

@IBInspectable
var scrubberWidth: Float = 4.0{
public var scrubberWidth: Float = 4.0{
didSet{
setNeedsLayout()
}
}

@IBInspectable
var dragIndicatorColor: UIColor = .lightGrayColor() {
public var dragIndicatorColor: UIColor = .lightGrayColor() {
didSet{
setupColor()
}
}

@IBInspectable
var barColor: UIColor = .lightGrayColor() {
public var barColor: UIColor = .lightGrayColor() {
didSet{
setupColor()
}
}

@IBInspectable
var elapsedColor: UIColor = .darkGrayColor() {
public var elapsedColor: UIColor = .darkGrayColor() {
didSet{
setupColor()
}
}

@IBInspectable
var verticalBarScale: Float = 1.0{
public var verticalBarScale: Float = 1.0{
didSet{
setNeedsLayout()
}
}

@IBInspectable
var scrubbingEnabled: Bool = true
public var scrubbingEnabled: Bool = true

@IBInspectable
var showDragArea: Bool = true{
public var showDragArea: Bool = true{
didSet{
setNeedsLayout()
}
Expand All @@ -86,26 +86,26 @@ class ScrubberBar: UIControl {
let topBar = UIView(frame: CGRectZero)
let elapsedBar = UIView(frame: CGRectZero)
var isDragging = false
weak var delegate: ScrubberBarDelegate?
public weak var delegate: ScrubberBarDelegate?

override init(frame: CGRect) {
super.init(frame:frame)
commonSetup()
}

required init?(coder aDecoder: NSCoder) {
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
commonSetup()
}

func setProgress(progress: Float){
public func setProgress(progress: Float){
if !isDragging {
self.progress = progress
setNeedsLayout()
}
}

override func prepareForInterfaceBuilder() {
public override func prepareForInterfaceBuilder() {
commonSetup()
}

Expand Down Expand Up @@ -146,7 +146,7 @@ class ScrubberBar: UIControl {
return (position / Float(frame.width)).clamped(0, upper: 1)
}

override func layoutSubviews(){
public override func layoutSubviews(){
super.layoutSubviews()
let horizontalPosition = positionFromProgress(progress)
draggerButton.frame = CGRectMake(CGFloat(horizontalPosition) , 0, CGFloat(scrubberWidth), frame.height)
Expand Down

0 comments on commit 6ee4ab7

Please sign in to comment.