swift getting empty data from file code example
Example: how to clear text file swift
let text = ""
do {
try text.write(to: filePath, atomically: false, encoding: .utf8)
} catch {
print(error)
}
let text = ""
do {
try text.write(to: filePath, atomically: false, encoding: .utf8)
} catch {
print(error)
}