Browse Source

Images set from local.

Iñigo Valentin 9 years ago
parent
commit
d77f5560c8
1 changed files with 8 additions and 0 deletions
  1. 8 0
      app/UIImageView.swift

+ 8 - 0
app/UIImageView.swift

@@ -42,6 +42,14 @@ extension UIImageView {
 		if fileManager.fileExists(atPath: filePath!) {
 			print("IMAGE:LOG: File available: \(filePath)")
 			//TODO Set image
+			do{
+				//let iurl = URL(string: filePath!)
+				let idata = try Data(contentsOf: URL(fileURLWithPath: filePath!))
+				self.image = UIImage(data: idata as Data)
+			}
+			catch (let error){
+				print("IMAGE:ERROR: Error setting image: \(error.localizedDescription)")
+			}
 			return 0
 		} else {
 			print("IMAGE:LOG: File not available: \(filePath)")