Read and write a String from text file
For reading and writing you should use a location that is writeable, for example documents directory. The following code shows how to read and write a simple string. You can test it on a playground. Swift 3.x – 5.x let file = “file.txt” //this is the file. we will write to and read from it … Read more