     
     public override func drawRect(rect: CGRect) {
         let center = CGPointMake(self.bounds.width/2, self.bounds.height/2)
-        let firstLabelTranslation = CGAffineTransformMakeTranslation(-CGFloat(numberOfComponents)/2.0*50.0+30.0, -8.0) // Move left half of width - 30.0, up 8.0
+        let firstLabelTranslation = CGAffineTransformMakeTranslation(-CGFloat(numberOfComponents)/2.0*componentWidth+30.0, -8.0) // Move left half of width - 30.0, up 8.0
         let firstLabelLeft = CGPointApplyAffineTransform(center, firstLabelTranslation)
         
         


import UIKit

public class DurationPickerView: UIPickerView {
    public var maximumDuration: NSTimeInterval = 0.0 {
        didSet {
            setNeedsDisplay()
            reloadAllComponents()
            
            if maximumDuration > 60*60 {
                selectRow(60*200, inComponent: 1, animated: false)
                selectRow(60*200, inComponent: 2, animated: false)
            }
        }
    }

        let componentUnit = pow(Float(60), Float(numberOfComponentsInPickerView(self)-component-1))
        
        let numberOfRows = Int(min(ceilf(Float(maximumDuration)/componentUnit)+1, 60.0))
        return numberOfRows < 60 ? numberOfRows : 60*1000
    }
}

