Closed sakicnet closed 7 years ago
Hello @sakicnet, this is a very good point about sharing the cache with the rest of the app. Thank you for the idea. There was already a setting in Moa for the cache directory. However, it was an internal property. I have made it public in the latest 8.0.2
version of moa.
Here is how to use it:
import moa
...
Moa.settings.cache.diskPath = "MyAppSharedCache"
Moa uses URLSession
for networking and caching. The cache directory should be shared if your other libraries use URLSession
as well.
As for your main question, removing moa dependency from Auk is a very reasonable thing to do. However, I want to keep Auk integrated with moa for the following reasons:
To summarise, your proposal is very sound and it has many advantages. However, for now, I would like the two libraries to stay integrated for simplicity of usage and code maintenance. Let me know if you agree or disagree.
Hi Evgenii,
Thanks for the cache settings. Unfortunately I have to use Swift 2.3 and older version for the moment (want to maintain compatibility with iOS 8 and major libraries that switched to Swift 3 already dropped support for iOS 8).
I agree 100% with your arguments. Ideally moa would be included while you would have an option to remove it and use another library. But I understand it would probably cause more problems than it's worth. Thankfully, it's easy enough to fork it and do the necessary changes.
Anyway, thanks for the great library and keep up the good work!
Thank you @sakicnet. I hope developers would not drop iOS 8.0 versions so early, given that it still has nearly 10% usage, which is millions of people. And yes, good idea about opening the Auk API for other downloaders, I will keep it in mind. Good luck with your project.
Closing the issue, feel free to reopen if needed.
Hello,
Would you consider decoupling Auk from moa and allow for using different image download library, like SDWebImage or AlamofireImage?
I made a switch to SDWebImage myself, only because it is used by another library and they can share the cache this way. Besides, no need to use multiple libraries in the same app that do the same thing.
I could make a PU with what I have if you like.
Thanks.