alamofireimage

How do I apply a Custom Filter

流过昼夜 提交于 2020-01-15 03:15:07
问题 I am using AlamofireImage to download an image from my CDN however I would like to apply a custom filter (Grey Scale) to SOME of the images that are downloaded. Currently I am using a scrollView to show all available images and if an image has a particular attribute, apply the filter. I am new to AlamofireImage so I don't know how to apply a custom filter. I have applied let imageFilter = BlurFilter(blurRadius: 10) to the filter parameter so I know the actual filter process is working but can

Swift 4 AlamofireImage with UITableView Cell

这一生的挚爱 提交于 2020-01-02 01:15:28
问题 I am using AlamofireImages to try to download an image from a server and display it in my table view cell, this is what I got, but my images does not appear, just the textLabel and detailTextLabel override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "trendingCell", for: indexPath) print(self.array[indexPath.row]) cell.textLabel?.text = (self.array[indexPath.row]["title"] as! String)

AlamofireImage af_setImageWithURL in a UITableViewCell without placeholder image

狂风中的少年 提交于 2020-01-01 08:43:28
问题 I'm using AlamofireImage to set an image on a UIImageView in a UITableViewCell like so: cell.imageView.af_setImageWithURL(url) The image doesn't show after downloading. It will show the image the second time when it's loaded from the memory cache. It seems that using a placeholder image makes all the difference. This works and prints the address of the (downloaded) image: cell.imageView.af_setImageWithURL(URL, placeholderImage: UIImage(named: "placeholder"), filter: nil, imageTransition:

Using disk cached images if present in Alamofire Images

与世无争的帅哥 提交于 2019-12-30 06:14:09
问题 I'm using the AlamofireImage library to cache downloaded images. Code: import UIKit import AlamofireImage class ViewController: UIViewController { @IBOutlet weak var firstImageView: UIImageView! @IBOutlet weak var secondImageView: UIImageView! let downloader = ImageDownloader() let URLRequest = NSURLRequest(URL: NSURL(string: "https://httpbin.org/image/jpeg")!) override func viewDidLoad() { super.viewDidLoad() requestFirstImage() } func requestFirstImage() { downloader.downloadImage

AlamofireImage saved-to-cache images are not really saved

佐手、 提交于 2019-12-25 07:59:56
问题 I'm using (trying) AlamofireImage. My saved-to-cache images are not really saved. my code include: import Alamofire import AlamofireImage let imageCache = AutoPurgingImageCache( memoryCapacity: 100 * 1024 * 1024, preferredMemoryUsageAfterPurge: 60 * 1024 * 1024 ) then i am saving an image myself using: imageCache.add(image, withIdentifier: path) but in the next run, it always returns nil when i try to fetch this image using the same path: if let image = imageCache.image(withIdentifier: path){

“too many HTTP redirects” while using Alamofire Upload Multipart Form Data

狂风中的少年 提交于 2019-12-20 04:16:36
问题 I'm using Alamofire 3 and encountered this: [Result]: FAILURE: Error Domain=NSURLErrorDomain Code=-1007 "too many HTTP redirects" UserInfo={NSUnderlyingError=0x15eb422d0 {Error Domain=kCFErrorDomainCFNetwork Code=-1007 "(null)"}, NSErrorFailingURLStringKey=URL omitted, NSErrorFailingURLKey= URL omitted, NSLocalizedDescription= too many HTTP redirects} while calling this method: upload(.POST, kTaskSubmitImageUrl, multipartFormData: { multipartFormData in multipartFormData.appendBodyPart(data:

AlamofireImage how to clean memory and cache

空扰寡人 提交于 2019-12-20 04:14:03
问题 I use Alamofire and AlamofireImage in my app for get data and photos. Alamofire.request(.GET, URLString, encoding: .JSON) .authenticate(user: user, password: password) .responseJSON() { (response) -> Void in if let jsonResult = response.result.value { if jsonResult.count > 0 { ... let photo_url = jsonResult[index]["Photo_url"] as! String Alamofire.request(.GET, photo_url) .authenticate(user: user_photo, password: password_photo) .responseImage { response in if let image = response.result

AlamoFire + SwiftyJSON on iOS 9.0

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 02:38:52
问题 I have been trying to install and use AlamoFire and SwiftyJSON on iOS 9 using CocoaPods. The latest version keeps getting installed and it is not compatible with iOS 9.0. My PodFile looks like this: platform :ios, '9.0' use_frameworks! target 'Kitchology' do pod 'Alamofire' pod 'SwiftyJSON' pod 'AlamofireImage' end I tried commenting them out and doing a pod install to remove them, then put them back in and do another pod install. Every time the latest is installed. I do have the project

AlamofireImage cache?

你离开我真会死。 提交于 2019-12-11 12:35:18
问题 I use AlamofireImage in conjunction with PromiseKit and Alamofire . I use promises to chain the download of x number of images since I want to do this synchronically. I can't seem to understand if ImageDownloader() caches automatically or if I have to add the image explicitly to the cache? The only examples I've seen so far are not using the ImageDownloader so I have a real hard time finding an answer to this. If not - how do I add it the cache? I've tried using: self.imageDownloader

Image downloading with progress using AlamofireImage?

孤街醉人 提交于 2019-12-10 15:55:36
问题 Is there any way to download an image using AlamofireImage and get some kind of feedback about the download progress while leveraging the power of it's UIImage Extensions, Image Filters and Image Cache ? I know I can fallback to a plain Alamofire.request + responseImage but I'd like to keep things simple and make use of the UIImageView Extension . Thank you! 回答1: There is not any way at the moment to use AlamofireImage alongside the UIImageView extension to receive progress updates when