         //completion(image)
     }
 }
-
-
-// wywolanie w ViewDidLoad() klasy Gallery View Controller:
-// PhotoManager.shared.getPhoto(from: "https://static.pexels.com/photos/347721/pexels-photo-347721.jpeg")

                })
            }).resume()
        } else if self.cache[url] != nil {
            print("2")
            image = self.cache[url]
        } else {
            print("Error")

    func getPhoto(from url: String/*, completion: ((UIImage?) -> Void)*/) {
        var image: UIImage? = nil
        if cache[url] == nil {
            //cache[url] = image
            URLSession.shared.dataTask(with: NSURL(string: url)! as URL, completionHandler: { (data, _, _) -> Void in // previously (data, response, error)
                DispatchQueue.main.async(execute: { () -> Void in
