SaveDialog
public class SaveDialog : FileDialog
The SaveDialog
provides an interactive dialog box for users to pick a file to save.
To use, create an instance of SaveDialog
, and call present with a callback
for completion. Then you can examine the fileName
property, that will
contain the selected file name ornil
if the user canceled.
-
Creates a new instance of the SaveDialog
Declaration
Swift
public init(title: String = "", message: String = "")
Parameters
title
Tilte to show for the dialog
message
Additional message to display in the save dialog
-
Gets the name of the file the user selected for saving, or
nil
if the user canceled theSaveDialog
Declaration
Swift
public var fileName: String? { get }
-
Use this method to present the dialog, the callback will be invoked when the dialog is closed, probe the
canceled
variable, if it is set to true, it means that the user did cancel the dialog, otherwise the selection is on thefileName
property (that variable is nil if the user canceled as well)Declaration
Swift
public func present(_ callback: @escaping (SaveDialog) -> ())