Skip to content

πŸ—„ Read files in Swift without Foundation

Notifications You must be signed in to change notification settings

divadretlaw/CFileWrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CFileWrapper

A simple wrapper for File handling in Swift without Foundation

You can read files, save files, append to files and list directories

Usage

if let hello = CFileWrapper.read("HelloWorld.txt") {
  print(hello)
}

Another way to read the file is using a completion handler

CFileWrapper.read("HelloWorld.txt") { text in
	guard let text = text else {
		print("Unable to read file")
		return
	}
	print(text)
}

You can also read by line with a delegate

class MyClass: CFileWrapperDelegate {
  func CFileWrapper(read line: String) {
    print(line)
  }
}

let myClass = MyClass()
CFileWrapper.readw("HelloWorld.txt", delegate: myClass)

About

πŸ—„ Read files in Swift without Foundation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages