ios – Read file line by line reversevely using swift


Is there any way to read a file line by line reversevely? For instance, if my file contains 100 lines, i want to be able to read file from line 100 to line 0, from bottom to top, line by line. The order of a content in lines must not be changed.

I searched for the use case using FileHandle class, where it will start by seeking to the end of file, and each time the offset will be decreasing to finally become 0, but found no implementation in swift.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img