-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
KFSwiftImageLoader #21
Comments
Thanks for the info! I will check it and get back to you! :) |
Hi! I managed to get it work by replacing the internal lazy var session: NSURLSession = { let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() configuration.requestCachePolicy = .ReturnCacheDataElseLoad configuration.URLCache = .sharedURLCache() return NSURLSession(configuration: configuration) }() with this internal lazy var session: NSURLSession = { let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() configuration.protocolClasses?.insert(NFXProtocol.self, atIndex: 0) //added line configuration.requestCachePolicy = .ReturnCacheDataElseLoad configuration.URLCache = .sharedURLCache() return NSURLSession(configuration: configuration) }() in the KFImageCacheManager.swift file Attention: You will get image log only the first time because KFSwiftImageLoader caches the images and doesn't request them again Please verify the workaround :) |
Also make sure you delete the app from the device/simulator and make a Product > Clean before you rebuild |
Hey Thanks! Confirmed this works in principal, though it was a little tricky coming up with a way to do it using both KF and NF as cocoa pods. Ended up exposing a way to modify the session configuration in KFSwiftImageLoader from the app which has visibility to Netfox module. Cheers. |
Nice :) Could you please post your workaround? |
All I did was to provide a way for an app to override the session configuration before the NSURLSession in KFImageCacheManager is initialized.
Then, upon starting the app, inject a config that puts the NFXProtocol in the middle to capture the image requests
It is a bit of a run-around, but it's working. |
PR #94 will solve issues like these |
Since #94 merged, I consider it as solved. Please come back with a new issue if not. 👍 |
Great tool!
Would you expect this to work with https://github.com/kiavashfaisali/KFSwiftImageLoader ?
I'm able to see other request/responses in netfox, except for those...
The text was updated successfully, but these errors were encountered: