Skip to content

Simple iOS class to delete files and subdirectories from the Documents and Library directories

Notifications You must be signed in to change notification settings

sketchytech/FileDelete_Swift_iOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FileDelete

Simple iOS class to delete files and subdirectories.

Note: If you are working with Swift, it is recommended that you use SwiftFiles, which combines FileDelete with FileSave and FileLoad. (SwiftFiles has a Swift 2 compatible branch.)

##Swift 1.2 (Xcode 6.3 beta 4) version methods:

// Delete files
FileDelete.deleteFile(path:String, directory:NSSearchPathDirectory,  subdirectory:String?) -> Bool
FileDelete.deleteFileFromTemporaryDirectory(path:String, subdirectory:String?) -> Bool

// Delete folders
FileDelete.deleteSubDirectory(directory:NSSearchPathDirectory, subdirectory:String) -> Bool
FileDelete.deleteSubDirectoryFromTemporaryDirectory(subdirectory:String) -> Bool

See companion class: FileSave ##Objective-C implementation (no longer updated) To use this code import the header where it is needed and use the following methods:

[FileDelete deleteFileFromDocumentsDirectory:@"helpme" inSubDirectory:nil];
[FileDelete deleteFileFromLibraryDirectory:@"helpme" inSubDirectory:@"help/theworld];

[FileDelete deleteSubDirectoryFromDocumentsDirectory:@"helpless"];
[FileDelete deleteSubDirectoryFromLibraryDirectory:@"Libraryofhelplessness/mine"];

About

Simple iOS class to delete files and subdirectories from the Documents and Library directories

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published