Search code examples
xcodeappkitnsdocument

On NSSavePanel, is there a way to force the “Hide extension” checkbox to show?


I have overridden NSDocument’s prepareSavePanel(_:) method to attempt to add a checkbox to allow the user to hide the filename extension when saving.

override func prepareSavePanel(_ savePanel: NSSavePanel) -> Bool {
        savePanel.canSelectHiddenExtension = true
        savePanel.isExtensionHidden = false
        return true
}

But the checkbox still won’t show on the Save panel.


Solution

  • "Hide Extension" is now in the pull-down menu.

    enter image description here