In my project I have two file .txt (in Resources folder), how can I copy them inside documents folder?
code for file is exist or not, if not then copy.
func CheckFileisExistOrNot(strPath:String) {
let filemgr = FileManager.default
if !filemgr.fileExists(atPath: strPath) {
let resorcePath = Bundle.main.path(forResource: "\(Global.g_databaseName)", ofType: ".db")
do {
try filemgr.copyItem(atPath: resorcePath!, toPath: strPath)
}catch{
print("Error for file write")
}
}
}