Advertisement
Guest User

Untitled

a guest
May 31st, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. func getTumbnails(imageName: String) {
  2. // Create a reference to the file you want to download
  3. let tumbnailRef = storageRef.child("tumbs/(imageName)")
  4. // Create local filesystem URL
  5. let localURL: NSURL! = NSURL(string: "file:///local/tumbnails/(imageName)")
  6.  
  7. // Download to the local filesystem
  8. let downloadTask = tumbnailRef.writeToFile(localURL) { (URL, error) -> Void in
  9. if (error != nil) {
  10. print(error)
  11. } else {
  12. let data = NSData(contentsOfURL: URL!)
  13. self.data = data!
  14. print(data)
  15. }
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement