Skip to content

Instantly share code, notes, and snippets.

@thatswiftguy
Created February 14, 2021 07:45
Show Gist options
  • Save thatswiftguy/a38bb700165ccb035376d30d0eb57856 to your computer and use it in GitHub Desktop.
Save thatswiftguy/a38bb700165ccb035376d30d0eb57856 to your computer and use it in GitHub Desktop.
func deleteRecording(url : URL){
do {
try FileManager.default.removeItem(at : url)
} catch {
print("Can't delete")
}
for i in 0..<recordingsList.count {
if recordingsList[i].fileURL == url {
if recordingsList[i].isPlaying == true {
stopPlaying(url: recordingsList[i].fileURL)
}
recordingsList.remove(at : i)
break
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment