I need to read and write data to/from a text file, but I haven\'t been able to figure out how.
I found this sample code in the Swift\'s iBook, but I still don\'t kno
Simplest way to read a file in Swift > 4.0
let path = Bundle.main.path(forResource: "data", ofType: "txt") // file path for file "data.txt" do { var text = try String(contentsOfFile: path!) } catch(_){print("error")} }