alexhillc / AXPhotoViewer

An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos.
https://www.cocoacontrols.com/controls/axphotoviewer
MIT License
646 stars 119 forks source link

" url = nil" does not seem to work. #25

Closed eastswift closed 6 years ago

eastswift commented 6 years ago

To insert an image of an asset, do the following:

for i in 0 ..< images.count - 1 { manager.requestImage(for: images[i], targetSize: CGSize(width: 100, height: 100.0), contentMode: .aspectFill, options: nil) { (result, _) in print(result) let resultphoto = Photo(image: result, url: nil) self.photos.append(resultphoto)
}

I have obviously put nil in the url, but I keep trying to download it. The image is imported from the asset.

   self.urlSession.dataTask(with: self.photos[indexPath.row].url!) { [weak self] (data, response, error) in
        guard let uData = data else {
            return
        }   

I get an error here.

alexhillc commented 6 years ago

Hey @eastswift, thanks for the report. I’ll take a look at this when I get some time!

alexhillc commented 6 years ago

This looks like it was simply a bug in the example project, which I had thrown together very sloppily to test out the framework. Sorry about that! Fixed in the latest commit.