How to show file type drop-down for for NSSavePanel?

I am wanting to show a drop-down for the file types that the user can use during save, but I am not sure how. Below is an extract of the Swift code I am using to display the save dialogue:

Code Block swift
let panel = NSSavePanel()
panel.allowedFileTypes = ["jpg", "jpeg", "png"];
panel.nameFieldStringValue = String(format: "Image %@ at %@.jpg", date, time);
panel.beginSheetModal(for: self.window) { (result) in
if (result == NSApplication.ModalResponse.OK) {
   // Handle file save here
}
}

You may need to use accessoryView.

You can fins some articles searching with nssavepanel accessoryview sample code.
If you do not mind description in Japanese, this site has some codes in Swift:
qiita.com/hanamiju/items/d10524e8650ae171fa2e

How to show file type drop-down for for NSSavePanel?
 
 
Q