I want to write sensor data to a file as the sensor updates within the method. I need to append the data as it updates, but my file overwrites with the last sensor output when I
Use seekToEndOfFile
seekToEndOfFile
let myHandle = FileHandle.init(forWritingAtPath: fileUrl.path) myHandle.seekToEndOfFile myHandle.write(strTowrite.data(using: String.Encoding.utf8)!) myHandle.closeFile()