Skip to content

Question? #161

@Droppix

Description

@Droppix

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions