CocoaPods trunk is moving to be read-only. Read more on the blog, there are 11 months to go.

FileLiner 1.0.0

FileLiner 1.0.0

Maintained by Ethem Ozcan.



FileLiner 1.0.0

  • By
  • Ethem Özcan

FileLiner

This Swift package helps you read a file line by line.

Installation

Swift Package Manager

.package(url: "https://github.com/ethemozcan/FileLiner.git", .upToNextMinor(from: "1.0.0"))

Usage

        import FileLiner

        do {
            let path = Bundle.main.path(forResource: "TestFile", ofType: "csv")
            let fileLiner = try FileLiner(path: path!)

            while fileLiner.hasLinesToRead {
                print(fileLiner.readLine()!)
            }
        } catch FileLinerError.fileNotExist {
             // Handle Error
        } catch FileLinerError.invalidDelimiter {
            // Handle Error
        } catch FileLinerError.invalidChunk {
            // Handle Error
        } catch {
            // Handle Error
        }