Skip to content

Instantly share code, notes, and snippets.

@frozzare
frozzare / file.swift
Created June 7, 2014 10:33
Example of how to create a file class with read, write and exists functions
import Foundation
class File {
class func exists (path: String) -> Bool {
return NSFileManager().fileExistsAtPath(path)
}
class func read (path: String, encoding: NSStringEncoding = NSUTF8StringEncoding) -> String? {
if File.exists(path) {