Instance Method

panel(_:validate:)

Asks the delegate to validate the URL for a file that the user selected.

Declaration

optional func panel(_ sender: Any, validate url: URL) throws

Parameters

sender

The panel that requests URL validation.

url

The URL for you to validate.

outError

If an error occurred during validation, the error that occurred.

Return Value

true if your app can open or save the item at the specified URL. Return false if you cannot open or save the item.

Discussion

Save panels call this method when the user clicks the Save button. Open panels call it when the user clicks the Open button. An Open panel calls this method once for each selected filename or directory.

See Also

Validating the Panel Content

func panel(Any, shouldEnable: URL) -> Bool

Asks the delegate whether the specified URL should be enabled in the Open panel.