Instance Method

unmountAndEjectDevice(at:)

Attempts to eject the volume mounted at the given path.

Declaration

func unmountAndEjectDevice(at url: URL) throws

Parameters

url

The URL of the volume to eject.

error

If the operation fails, this error contains more information about the failure.

Return Value

true if the system successfully unmounted and ejected the volume; otherwise false. For example, the method might return false if the volume is not ejectable.

Discussion

You can safely call this method from any thread of your app.

See Also

Unmounting a Device

func unmountAndEjectDevice(atPath: String) -> Bool

Unmounts and ejects the device at the specified path.