Learn Courses My Dashboard

I'm pretty sure the asset is in the folder, but it comes up as nil

I’m trying to get the URL for the image in my asset folder.

Screen Shot 2021-05-07 at 9.12.51 PM

But I get a fatal error because it was nil and I unwrapped it.

You don’t have to obtain the URL for an asset. All you have to do is reference it by name.

In UIKit:

let image = UIImage(named: "flower")

In SwiftUI


I guess you’re right.

Eventually I’ll want to find an image on the device that the user just took. I used this tutorial. https://betterprogramming.pub/effortless-swiftui-camera-d7a74abde37e

But I don’t know where this camera stores the images.

You will need to access their photo library. Not necessarily accessing files stored on the device

It looks like the camera app just returns photo data. It doesn’t store it on the device.

And maybe that’s fine, I can just use the photo data as it comes off the camera, instead of saving it to the device and then retrieving it from the device?

I’m going to try that for a while; I’ll come back if I need more help.