fileManager.removeItem(at: fileURL) gone for good?

fileManager.removeItem(at: fileURL) does it move the file to a "trash can" type directory or is it gone for good?

Accepted Reply

It’s gone for good. iOS does not have the concept of the trash, but on platforms that do, the only relevant one being macOS, you would move something to the trash using

-[NSFileManager trashItemAtURL:resultingItemURL:error:]
.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

It’s gone for good. iOS does not have the concept of the trash, but on platforms that do, the only relevant one being macOS, you would move something to the trash using

-[NSFileManager trashItemAtURL:resultingItemURL:error:]
.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thank you. That is what I thought, but just wanted to doublecheck.