CollectionKit icon indicating copy to clipboard operation
CollectionKit copied to clipboard

Question?

Open Droppix opened this issue 3 years ago • 0 comments

Hi,

I have a problem with the sourceSize implementation. What would be the best way to implement the display images from the url, knowing that each has a different size.

let imagesProvider = BasicProvider(
            dataSource: dataSource,
            viewSource: ClosureViewSource(viewGenerator: { (data, index) -> UIImageView in
                let view = UIImageView(image: UIImage(named:"pic_picture_placeholder"))    
                view.layer.cornerRadius = 5
                view.clipsToBounds = true
                                            
                return view
            }, viewUpdater: { (view: UIImageView, data: JSON, at: Int) in
                        // ASync call
                        DataStoreImage.shared.load(data["url"].string, view) { image in
                               ...
                               view.image = image
                               // how reload cell with resize ?
                        })
           },
           sourceSize: ??
}

Any suggestions?

Droppix avatar Apr 04 '22 15:04 Droppix