How to get if the file with same name already exists on document directory iOS swift?
Solution:
The below code used for check if the file with the same name already exists in the document directory.And it will remove the existing file.
code:
if fileManager.fileExists(atPath: mergeAudioFiles.path!) {
do{
try fileManager.removeItem(atPath: path!)
} catch {
//Do nothing
}
}
The below code used for check if the file with the same name already exists in the document directory.And it will remove the existing file.
code:
if fileManager.fileExists(atPath: mergeAudioFiles.path!) {
do{
try fileManager.removeItem(atPath: path!)
} catch {
//Do nothing
}
}
Comments
Post a Comment