Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question? #161

Open
Droppix opened this issue Apr 4, 2022 · 0 comments
Open

Question? #161

Droppix opened this issue Apr 4, 2022 · 0 comments

Comments

@Droppix
Copy link

Droppix commented Apr 4, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant