Closed KanybekMomukeyev closed 8 years ago
Hey,
I've fixed (1). My bad, should have marked the initialiser as public! It's in v1.1.1, published to Cocoapods.
I could not replicate your error though. That error could be caused because you're passing in CGRectZero
. Try doing it with some actual dimensions. For eg. CGRectMake(0,0,100,100)
. I've added an example of creating the view in code to the example project.
With regards to (2), async image downloading is out of scope for this library. The approach I would recommend is to have your own network layer that downloads the image and then updates the avatar
field in AvatarImageViewDataSource
. After updating that field, call refresh()
on the AvatarImageView
. Here's a good tutorial on how to lazy load images: https://developer.apple.com/library/ios/samplecode/LazyTableImages/Introduction/Intro.html
I will add an example of this to the example project when I get some time, probably not in the next few days though.
I haven't used SDWebImage
unfortunately so I can't recommend a good approach with that. At first look it seems unlikely that it will work with this library as it is a category on UIImageView
and this library relies on a data source to generate its content.
Hope that helps!
Cheers, Ayush
(1)
This gives me error issue "expected a coder: NSCoder" ?
should we write like this in init:
Tried to use, but no success:
Can you write example with pragmatic usage?
(2) Another question, how about with SDWebImage, how we should update asynchronous image in avatar, which downloaded?