I have created a VideoAssets folder within documentsDirectory as below, which can contain one or more video assets:
file:///private/var/mobile/Containers/Data/Application/2E3H5FDD-825D-407A-A8BE-71CD540A6E15/Documents/VideoAssets/ae6e4f59be0bc5984b043e.mp4
Periodically it needs to be cleaned out. How can I either empty the folder OR remove the VideoAssets folder in it's entirety? There's a fair bit of info out there for creating folders, but not for removing one.
Just use
try FileManager.default.removeItem(at: directoryUrl)From Apple's docs:
https://developer.apple.com/documentation/foundation/filemanager/1413590-removeitem