sdwebimage

Insert Authorization Header field with kingfisher lib

送分小仙女□ 提交于 2019-12-06 23:59:45
问题 I'm using Kingfisher to show image from url, but my endpoint requires a Authorization header. How to use these kind of url with Kingfisher or SDWebImage in iOS? 回答1: With Kingfisher you need to make a request modifier (of type AnyModifier ) and pass it as a parameter in the options part of the .kf.setImage method, and then use the trailing closure to actually set the image. Example: import Kingfisher let modifier = AnyModifier { request in var r = request // replace "Access-Token" with the

SDWebImage/UIImageView+WebCache.h File Not Found Error

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 15:35:54
问题 I Integrated SDWebImage in my project , its work like a charm in my mac system but while i am sending my project to other mac system its showing error like SDWebImage/UIImageView+WebCache.h File Not Found but the same project working in my system .some time i i am also getting the same error in my mac system after running the project continuously for 2 to 3 days i tried all the ways like changing path to project>target>Build Settings>'header search paths>$(SOURCE_ROOT)/SDWebImage also tried $

Get SDWebImage Cache Image

安稳与你 提交于 2019-12-06 12:21:56
问题 I would like to ask on how to get the downloaded image after the SDWebImageManager downloaded it. I have only the code to download it via URL, here's what I got: let manager: SDWebImageManager = SDWebImageManager.sharedManager() manager.downloadImageWithURL(NSURL(string: feedDetails.thumbnail), options: [], progress: {(receivedSize: Int, expectedSize: Int) -> Void in print(receivedSize) }, completed: {(image, error, cached, finished, url) -> Void in self.feedImage.image = image } ) 回答1: From

SDWebImage showing placeholder for images in cache

て烟熏妆下的殇ゞ 提交于 2019-12-06 10:28:16
问题 Using SDWebImage 3 in an iOS 5.1 project (iPad). We show fairly large images( 700x500), and we have lots of them (+1000). We are prefetching the images and caching to disk and then allows the user browse through them. It works fine. Except that while you browse through the images you always see for an slight moment that the placeholder is displayed, creating a very annoying effect. In my use case it would be much more preferable to wait the small time to check the disk cache and process than

Download Images One By One with url using SDWebimage

蓝咒 提交于 2019-12-06 08:43:10
问题 I need to Download images from Array of Url's, one by one and Display all at a Time. Ex. I have an array of 10 URL's and I need to Download image One By One only, and display at a time. I am Using SDWebImage for Download Images. Please Help me. Thanks. 回答1: You can try something like this -(void)downloadImage { if self.urlArray.count > 0) { NSURL *url = [NSURL URLWithString:[self.urlArray firstObject]]; SDWebImageManager *manager = [SDWebImageManager sharedManager]; [manager

Strange UITableViewCellStyleSubtitle + [cell imageView] behaviors

冷暖自知 提交于 2019-12-06 06:29:05
This question's been bugging me for a month and i've been resisting posting about it, but I can hold out no longer. Here's what's going on: I have an app with UITableViewCell s, all initialized as UITableViewCellStyleDefault . For each one, I am setting the image view's image using the excellent SDWebImage package, which extends UIImageView to have a method for [UIImageView setImageWithURL:(NSURL*)url placeholderImage:(UIImage*)image]. The problem is that the images are showing up more narrow than they should be, on the tableView, but for some reason selecting a row makes it the correct size.

SDWebImage UITableView Cell Images Not Persisting

半腔热情 提交于 2019-12-06 04:17:41
问题 I am using SDWebImage library in order to download and cache images and from a web service asynchronously. Following is the method i use to download the images: - (void) downloadThumbnails:(NSURL *)finalUrl { SDWebImageManager *manager = [SDWebImageManager sharedManager]; [manager downloadWithURL:finalUrl options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) { if (image) { [self setThumbnail:image]; } }]; } It is successfully downloading

Why SDWebImage do not show image in a cell after load?

风流意气都作罢 提交于 2019-12-06 03:44:55
I am using SDWebImage. In my table, each row has image and a label. As you can see, image cannot be seen. But when I go back to parent view controller, and come here again, they are shown. The code I am using is: [cell.imageView setImageWithURL:[NSURL URLWithString:serie.image] placeholderImage:[UIImage imageNamed:@"placeholder.png"] options:SDWebImageRefreshCached]; So, where I am wrong? Answer: get/make a transparent png, and use it as your placeholder image. Actually, it is not a bug with SDWebImage, but rather it's the nature of how UITableView works. SetImageWithURL, is an asynch process.

Xcode: SDWebImage clear cache for single image

余生颓废 提交于 2019-12-05 11:45:02
问题 I'm using SDWebImage to asynchronous image downloader with cache support. It's working perfectly except that sometimes the image got updated on the server with same name, thus I need to clear it from client device cache but no success! I found here that I have to use "removeImageForKey" but it's not recognized by Xcode! I'm using the following code to set the image: [imgPic setImageWithURL:[NSURL URLWithString:@"http://domain.com/image.jpg"] placeholderImage:[UIImage imageNamed:@"tmpPic.png"]

SDWebImage Cancel download

非 Y 不嫁゛ 提交于 2019-12-05 10:52:48
I am using SDWebimage to load images on my tablkeview I am following this tutorial Now I stuck on a problem,If I scroll down and hit back before images get loaded the app got crashes.How can I solve this ? How to cancel the SDWebImage download. I have gone through some answers and discussions.But none of them helped me and could not use them Please help me I am using [cell.UserImage setImageWithURL:[NSURL URLWithString:[SDWebArray objectAtIndex:indexPath.row]] placeholderImage:[UIImage imageNamed:@"Placeholder.png"]]; In your cell, you can cancel the image load if it's going to get re-used. In