Swift: Setting progress of NSProgressIndicator

I have tried to setup my own NSProgressIndicator with the following method.

class ProgressViewController : NSViewController 
{
    override func loadView()
    {
        let view = NSView(frame: NSMakeRect(0,0,300,120))
        view.wantsLayer = true
        view.layer?.borderWidth = 0
        self.view = view

        let text = NSTextField(frame: NSRect(x: 20, y: 45, width: 260, height: 20))
        text.drawsBackground = true
        text.isBordered = false
        text.backgroundColor = NSColor.controlColor
        text.isEditable = false
        self.view.addSubview(text)
        text.stringValue = "Progress Text"

        let indicator = NSProgressIndicator(frame: NSRect(x: 20, y: 20, width: 260, height: 20))
        indicator.minValue = 0.0
        indicator.maxValue = 100.0
        indicator.doubleValue = 33.0
        self.view.addSubview(indicator)
    }
}

My problem is that the indicator is always shown full. Am I missing a trick?


ANSWERS:


The default style is indeterminate. Set it to false and everything should be OK:

indicator.isIndeterminate = false


 MORE:


 ? Swift 3 Conversion
 ? Swift 3 Conversion
 ? Swift 3 Conversion
 ? Long cycle blocks application
 ? What is equivalent of "dispatch_apply" in Swift 3?
 ? What is equivalent of "dispatch_apply" in Swift 3?
 ? What is equivalent of "dispatch_apply" in Swift 3?
 ? How to set edgesForExtendedLayout to none in Swift 3
 ? Cocoa - Application Freezes During Loading Data From XML
 ? Cocoa - Application Freezes During Loading Data From XML