dmytro-anokhin / url-image

AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.
MIT License
1.1k stars 96 forks source link

Compilation error 0.9.15 via Cocoapods and Swift version 5.2.2 #69

Closed ospfranco closed 4 years ago

ospfranco commented 4 years ago

Summary and/or background I installed the library via cocoa pods, when trying to run the project I got a compilation error on DownloadService.swift

OS and what device you are using

Version of URLImage library The version of the library where the bug happens.

What you expected would happen No compilation error

What actually happens On DownloadService.swift line 200: private weak var urlSessionDelegate: URLSessionDelegateWrapper I get a compiler error:

'weak' variable should have optional type 'URLSessionDelegateWrapper?'

Additional information:

Screenshot 2020-05-10 at 07 50 25

ospfranco commented 4 years ago

Here si one more thing, I manually added a unwrapping operator, but when the download finishes now I'm getting another crash because the delegate has been deallocated, I'm not a swift expert, don't know if this helps or not

Screenshot 2020-05-10 at 07 56 07

ospfranco commented 4 years ago

I'm sorry, my bad, I have swiftlint autocorrect turned on and it modified the source file, causing this error, de-activating it makes everything work, thanks a lot for the package!