Post

Replies

Boosts

Views

Activity

Reply to What is the current proper way to load an image from local filesystem?
@DTS Engineer is correct. I ended up utilizing the new URL's static variable like URL.applicationSupportDirectory and the new method appending(path:directoryHint:) and the final code is: func findImage(name: String) -> UIImage? { let url = URL.applicationSupportDirectory .appending(path: "MyFolder", directoryHint: .isDirectory) .appending(path: "\(name).png", directoryHint: .notDirectory) return UIImage(contentsOfFile: url.path(percentEncoded: false)) } Writing this as an answer to checkout the final code. Don't know whether there is a better way than UIImage(contentsOfFile:) but it does the job for now ¯\ _ (ツ) _ /¯
Jul ’24