osx nsslider call function while changing

156 Views Asked by At

i working with swift 3 for osx and i have a pdf view like this:

@IBOutlet weak var pdfView: PDFView!

let dictDocuments = NSURL(fileURLWithPath: NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0])
let completePath = dictDocuments.appendingPathComponent("test.pdf")
let pdfDocument = PDFDocument(url: completePath!)
pdfView.document = pdfDocument

now i would like to zoomIn / Out the pdf view with a nsslider. for this i have this function:

@IBAction func zoomPreview(_ sender: NSSlider) {
   pdfView.scaleFactor = CGFloat(sender.doubleValue)
}

this works, but: the "zoom function" will call when i move the slider and release it.

but i would like to call the zoom function directly while the slider is changing.

is there an delegate function for the nsslider like "isChanging" ore something like that?

0

There are 0 best solutions below