evgenyneu / moa Goto Github PK
View Code? Open in Web Editor NEWAn image download extension of the image view written in Swift for iOS, tvOS and macOS.
License: MIT License
An image download extension of the image view written in Swift for iOS, tvOS and macOS.
License: MIT License
I am using Carthage. I got error while installing.
MacBook-Pro:ios yuchen$ carthage update --platform iOS
*** Fetching Alamofire
*** Fetching SwiftyJSON
*** Fetching Auk
*** Fetching moa
*** Checking out Alamofire at "3.4.2"
*** Checking out SwiftyJSON at "2.3.3"
*** Checking out Auk at "6.0.0"
*** Checking out moa at "8.0.0"
*** xcodebuild output can be found in /var/folders/1l/4rd_dg795n34hsrry55z09_m0000gn/T/carthage-xcodebuild.36neIV.log
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
*** Building scheme "moa" in moa.xcodeproj
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Logger/MoaConsoleLogger.swift:12:30: warning: extraneous '_' in parameter: 'type' has no keyword argument name
public func MoaConsoleLogger(_ type: MoaLogType, url: String, statusCode: Int?, error: Error?) {
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:51:4: error: unknown attribute 'discardableResult'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:52:31: warning: extraneous '_' in parameter: 'urlPart' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:69:4: error: unknown attribute 'discardableResult'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:70:43: warning: extraneous '_' in parameter: 'urlPart' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:89:4: error: unknown attribute 'discardableResult'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:90:43: warning: extraneous '_' in parameter: 'urlPart' has no keyword argument name
public static func autorespondWithError(_ urlPart: String, error: Error? = nil,
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:103:37: warning: extraneous '_' in parameter: 'url' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:109:32: warning: extraneous '_' in parameter: 'url' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:156:32: warning: extraneous '_' in parameter: 'image' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:171:32: warning: extraneous '_' in parameter: 'error' has no keyword argument name
public func respondWithError(_ error: Error? = nil, response: HTTPURLResponse? = nil) {
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttp.swift:10:17: error: unknown attribute 'escaping'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttp.swift:11:15: error: unknown attribute 'escaping'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttp.swift:9:30: warning: extraneous '_' in parameter: 'url' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttp.swift:23:17: error: unknown attribute 'escaping'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttp.swift:24:15: error: unknown attribute 'escaping'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImage.swift:11:17: error: unknown attribute 'escaping'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImage.swift:12:15: error: unknown attribute 'escaping'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImage.swift:10:30: warning: extraneous '_' in parameter: 'url' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImage.swift:22:29: warning: extraneous '_' in parameter: 'data' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImage.swift:57:37: warning: extraneous '_' in parameter: 'mimeType' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulatedImageDownloader.swift:27:49: error: unknown attribute 'escaping'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulatedImageDownloader.swift:28:15: error: unknown attribute 'escaping'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulatedImageDownloader.swift:27:22: warning: extraneous '_' in parameter: 'url' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulatedImageDownloader.swift:53:32: warning: extraneous '_' in parameter: 'image' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulatedImageDownloader.swift:66:32: warning: extraneous '_' in parameter: 'error' has no keyword argument name
public func respondWithError(_ error: Error? = nil, response: HTTPURLResponse? = nil) {
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Utils/MoaTime.swift:5:23: warning: extraneous '_' in parameter: 'date' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpSession.swift:22:49: error: expected member name following '.'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpSession.swift:22:49: error: consecutive statements on a line must be separated by ';'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpSession.swift:22:49: error: 'default' label can only appear inside a 'switch' statement
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpSession.swift:78:1: error: expected '}' at end of brace statement
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpSession.swift:78:1: error: expected declaration
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImageDownloader.swift:22:49: error: unknown attribute 'escaping'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImageDownloader.swift:23:15: error: unknown attribute 'escaping'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImageDownloader.swift:22:22: warning: extraneous '_' in parameter: 'url' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImageDownloader.swift:39:35: error: boolean condition requires 'where' to separate it from variable binding
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/MoaImageDownloader.swift:5:49: error: unknown attribute 'escaping'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/MoaImageDownloader.swift:6:15: error: unknown attribute 'escaping'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/MoaImageDownloader.swift:5:22: warning: extraneous '_' in parameter: 'url' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Logger/MoaLoggerText.swift:20:27: warning: extraneous '_' in parameter: 'type' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Moa.swift:180:30: warning: extraneous '_' in parameter: 'url' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Moa.swift:205:35: warning: extraneous '_' in parameter: 'image' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Moa.swift:229:39: warning: extraneous '_' in parameter: 'image' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Moa.swift:248:33: warning: extraneous '_' in parameter: 'error' has no keyword argument name
private func handleErrorAsync(_ error: Error?, response: HTTPURLResponse?, isSimulated: Bool) {
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Utils/MoaString.swift:8:24: warning: extraneous '_' in parameter: 'text' has no keyword argument name
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Logger/MoaConsoleLogger.swift:12:88: error: use of undeclared type 'Error'
public func MoaConsoleLogger(_ type: MoaLogType, url: String, statusCode: Int?, error: Error?) {
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Logger/MoaLoggerText.swift:21:10: error: use of undeclared type 'Error'
error: Error?) -> String {
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:90:69: error: use of undeclared type 'Error'
public static func autorespondWithError(_ urlPart: String, error: Error? = nil,
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:91:15: error: use of undeclared type 'HTTPURLResponse'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:140:37: error: use of undeclared type 'Error'
var autorespondWithError: (error: Error?, response: HTTPURLResponse?)?
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:171:41: error: use of undeclared type 'Error'
public func respondWithError(_ error: Error? = nil, response: HTTPURLResponse? = nil) {
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulator.swift:171:65: error: use of undeclared type 'HTTPURLResponse'
public func respondWithError(_ error: Error? = nil, response: HTTPURLResponse? = nil) {
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulatedImageDownloader.swift:18:37: error: use of undeclared type 'Error'
var autorespondWithError: (error: Error?, response: HTTPURLResponse?)?
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulatedImageDownloader.swift:66:41: error: use of undeclared type 'Error'
public func respondWithError(_ error: Error? = nil, response: HTTPURLResponse? = nil) {
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulatedImageDownloader.swift:66:65: error: use of undeclared type 'HTTPURLResponse'
public func respondWithError(_ error: Error? = nil, response: HTTPURLResponse? = nil) {
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttp.swift:11:59: error: use of undeclared type 'URLSessionDataTask'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttp.swift:24:59: error: use of undeclared type 'URLSessionDataTask'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttp.swift:13:24: error: use of unresolved identifier 'URL'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaError.swift:8:23: error: use of undeclared type 'Error'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImage.swift:12:59: error: use of undeclared type 'URLSessionDataTask'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImage.swift:22:37: error: use of undeclared type 'Data'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImage.swift:23:15: error: use of undeclared type 'HTTPURLResponse'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImage.swift:25:15: error: use of undeclared type 'Error'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulatedImageDownloader.swift:21:18: error: use of undeclared type 'Error'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Simulator/MoaSimulatedImageDownloader.swift:28:25: error: use of undeclared type 'Error'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/MoaImageDownloader.swift:6:25: error: use of undeclared type 'Error'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Utils/MoaTime.swift:5:31: error: use of undeclared type 'Date'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Utils/MoaTime.swift:6:25: error: use of unresolved identifier 'DateFormatter'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Utils/MoaTime.swift:7:20: error: use of unresolved identifier 'TimeZone'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Utils/MoaTime.swift:9:27: error: use of unresolved identifier 'Locale'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Utils/MoaTime.swift:18:20: error: use of unresolved identifier 'Date'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpSession.swift:5:38: error: use of undeclared type 'URLSession'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpSession.swift:7:23: error: use of undeclared type 'URLSession'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpSession.swift:7:23: error: use of undeclared type 'URLSession'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpSession.swift:7:23: error: use of undeclared type 'URLSession'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpSession.swift:21:45: error: use of undeclared type 'URLSession'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaError.swift:8:13: error: type 'MoaError' does not conform to protocol 'RawRepresentable'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaError.swift:55:21: error: use of undeclared type 'Error'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/MoaSettingsCache.swift:25:47: error: 'CachePolicy' is not a member type of 'NSURLRequest'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/MoaSettingsCache.swift:25:14: error: could not infer type for 'requestCachePolicy'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImageDownloader.swift:4:13: error: use of undeclared type 'URLSessionDataTask'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Logger/MoaLoggerCallback.swift:15:65: error: use of undeclared type 'Error'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Http/MoaHttpImageDownloader.swift:23:25: error: use of undeclared type 'Error'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Moa.swift:151:25: error: use of undeclared type 'Error'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Moa.swift:163:30: error: use of undeclared type 'Error'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Moa.swift:248:42: error: use of undeclared type 'Error'
private func handleErrorAsync(_ error: Error?, response: HTTPURLResponse?, isSimulated: Bool) {
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Moa.swift:248:60: error: use of undeclared type 'HTTPURLResponse'
private func handleErrorAsync(_ error: Error?, response: HTTPURLResponse?, isSimulated: Bool) {
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Moa.swift:216:7: error: use of unresolved identifier 'DispatchQueue'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Moa.swift:256:7: error: use of unresolved identifier 'DispatchQueue'
/Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/Moa/Utils/MoaString.swift:12:19: error: type 'NSString' has no member 'CompareOptions'
A shell task (/usr/bin/xcrun xcodebuild -project /Users/yuchen/Projects/zjsk/liuliang/ios/Carthage/Checkouts/moa/moa.xcodeproj -scheme moa -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
Hello, great work, really appreciate simplicity of this lib, but I found myself in a situation when I would like to determine if image was really downloaded or loaded from a cache - for example to show or not to show an animation, is there a simple way to determine that (maybe using duration field in MoaImage)?
desired example:
profileImage.moa.onSuccessAsync = { image in
if !image.loadedFromCache {
UIView.animate(withDuration: 0.3, animations: {
self.profileImage.layer.opacity = 1.0
})
}
return image
}
LCR images are not showing up using moa in tvOS
Can you add an old version branch
@evgenyneu your library does not work for me. Unfortunate..
My downloads are getting cancelled all the time. What should I do?
Here is my code:
let moa = Moa()
moa.onSuccess = { image in
// image is loaded
mediaMessage.image = image
DispatchQueue.main.async(execute: {
self.tableView.reloadData()
})
return image
}
moa.url = sendedImageURL
Console output:
[moa] 2017-05-06 07:15:51.210 GET https://**
[moa] 2017-05-06 07:15:51.212 Cancelled https://**
If setting breakpoint debugger does not wanna go inside closures at all...
Image never gets loaded..:(
Hi,
FreeOTP iOS https://github.com/freeotp/freeotp-ios fails to build moa as a dependency with Xcode 14.3
ld: file not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/Users/justinstephenson/github/freeotp-ios/Carthage/Checkouts/moa/moa.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 11.0 to 16.4.99. (in target 'moa' from project 'moa')
Please refer to https://developer.apple.com/forums/thread/728021
Thanks for sharing this lib!
Does this lib cache images by default? Or must I change some settings in Moa?
This might not belong here but does Moa clear the cache once it get full?
I am used to Kingfisher where most of the stuff is configured out of the box, cache clear, cache time etc
Hi
I m facing some issue when table view reload on swipe the screen flicker with white for 1 sec .
Is there way to stop flicker the table view reload and image called form server
ii -
First off, great work :)
Noticed you added .gif support to auk 2.1.5. Unable to download .gif files. Pointing my podfile directly to the master branch on Auk & moa.
Here's an example link that we're trying to download: http://circaoldhouses.com/wp-content/uploads/2016/04/7700-Highway-207-Anderson-AL-35610-3.gif
Here's the error code from the failure in moa:
Error Domain=MoaError Code=3 "Response content type is not an image type. Content type needs to be 'image/jpeg', 'image/pjpeg' or 'image/png'" UserInfo={NSLocalizedDescription=Response content type is not an image type. Content type needs to be 'image/jpeg', 'image/pjpeg' or 'image/png'}
What other information can I provide to be helpful?
Michael
Is there any way (I've dug a little in the repository) to invalidate (flush) the both memory and disk cache from Moa to force re-download all the following requests even if they were already cached?
Thank you!
Hi,
Moa has the feature to add placeholder image until image download complete ?
I'm trying to load multiple images using the same instance of moa, but the first image gets canceled, this happens even if it's cached
I'm not loading onto a image view because I'm using SwiftUI and this is they way I found to make it work
let moa = Moa()
moa.onSuccess = { image in
let img = Image(nsImage: image)
callback(img)
return image
}
moa.url = url
I also have these settings
Moa.settings.cache.memoryCapacityBytes = 500 * 1024 * 1024
Moa.settings.cache.diskCapacityBytes = 10000 * 1024 * 1024
Moa.settings.cache.diskPath = "ImageCache"
Moa.settings.cache.requestCachePolicy = .returnCacheDataElseLoad
Moa.settings.maximumSimultaneousDownloads = 10
Moa.settings.requestTimeoutSeconds = 20
Moa.logger = MoaConsoleLogger // test logger
Hi
I'm having same errors after install version 5.0
File: MoaHttpSession.swift
configuration.timeoutIntervalForRequest = Moa.settings.requestTimeoutSeconds
configuration.timeoutIntervalForResource = Moa.settings.requestTimeoutSeconds
configuration.httpMaximumConnectionsPerHost = Moa.settings.maximumSimultaneousDownloads
configuration.requestCachePolicy = Moa.settings.cache.requestCachePolicy
MoaHttpSession.swift:26:5: Function 'configuration' was used as a property; add () to call it
File: MoaString.swift
if ignoreCase { _ = options.insert(NSString.CompareOptions.caseInsensitive) }
if ignoreDiacritic { _ = options.insert(NSString.CompareOptions.diacriticInsensitive) }
'NSString.CompareOptions' has no member 'caseInsensitive'
'NSString.CompareOptions' has no member 'diacriticInsensitive'
Best regards
Davjd
Would be great to customize headers of all requests for images that are behind a secure endpoint
Hi,
What cache policy is the best to use to save images in cache so the user will be able to see them even if he is not have internet connection ?
and
When the image link has changed from the server, then load the new image over the cached image ?
I tested the Moa.settings.cache.requestCachePolicy = .ReturnCacheDataElseLoad
but it seems it doesn't do this thing I want.
Getting this error while trying to load certain images ( some work, other don't )
moa.MoaError.notAnImageContentTypeInResponseHttpHeader
Library setup method: CocoaPods.
Version of the library: 11.0.1
Xcode version: 11.1
OS version. Example: iOS 13.0
Hey guys, is there any way to animate an image after it downloads.
More like a subtle opacity change.
How can I do that?
Thanks for the amazing library!
I have detected a issue with the cache behavior. From the server in the image response header I get following cache related fields:
Cache-Control: public, max-age=30
Etag: 0x8D3968523DB2C1F
Last-Modified: Fri, 17 Jun 2016 07:58:16 GMT
If I scrolling the tableView up and down the images getting cached or newly requested with the
request header fields:
If-Modified-Since: Mon, 30 May 2016 10:28:33 GMT
If-None-Match :0x8D3968523DB2C1F
In that case the response status code is 304 and the images are loaded from the cache.
So fare so good. But when the scrolling frequency is getting higher the images are sometimes loaded again and again without the If-Modified-Since
and If-None-Match
header fields set.
I using the standard cache configuration.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.