In iOS 9+ I get a nil on any attempt to read from file. The file in this case is a image file path. using
NSData(contentsOfFile: stringpath, options: NSD
You are most likely getting this error, because iOS apps only have access to files within its sandbox. See Apple documentation on file systems for details.