sddownloadmanager error while download again swift

 Problem:

I'm using sddownloadmanager for file downloading.First time it works good.After download i had tried one more time it was went to error that in cache the image already exist.How to solve that?

Solution:

I had faced the same problem.I had tried that i will declare one global variable for cache path.In first time download success with that i had remove the lastpath in the url and assigned that value to the global cache path.

Next time onwards if error came then get the global cache path and append my file name that tried to download then preview with that file.It works well..

Happy coding..


Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift