Created
March 18, 2016 01:27
-
-
Save KrisYu/2a1e70700a5e6458e6ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func printData(){ | |
guard let path = NSBundle.mainBundle().pathForResource("contacts", ofType: "txt") else { | |
print("Error while reading data") | |
return | |
} | |
do { | |
let content = try String(contentsOfFile: path, encoding: NSUTF8StringEncoding) | |
print(content) | |
// return content | |
} catch _ as NSError{ | |
return | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment