Delete a file

 Problem

I want to delete/remove a file at a given location.



 Recipe


// Create a FileManager instance

let fileManager = NSFileManager.defaultManager()

// Delete 'hello.swift' file

do {
    try fileManager.removeItemAtPath("hello.swift")
}
catch let error as NSError {
    print("Ooops! Something went wrong: \(error)")
}
				


 Playground