In Swift the FileHandle class has a lot of deprecated methods. For example:
FileHandle.close
FileHandle.readDataToEndOfFile
both are marked as deprecated.
What are supposed to use?
At the end of FileHandle documentation page, you have the list of instance methods that you can use:
- func close()
- func offset() -> UInt64
- func read(upToCount: Int) -> Data?
- func readToEnd() -> Data?
- func seek(toOffset: UInt64)
- func seekToEnd() -> UInt64
- func synchronize()
- func truncate(atOffset: UInt64)
- func write(contentsOf: T)