UIImage(contentsOfFile:) returning nil despite file existing in caches directory [duplicate]
Solution 1:
The problem there is that you are using URL property absoluteString where you should be using the path property. The difference between absoluteString
and path
properties is that absoluteString includes the file url scheme ("file://") which is the reason it doesn't find the file at what was supposed to be its path but it is actually its absoluteString.